Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
WeaponBagClass.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_WEAPONBAGCLASS_H
13#define TT_INCLUDE_WEAPONBAGCLASS_H
14#include "ArmedGameObj.h"
15class WeaponDefinitionClass;
16class InventoryClass;
17class WeaponBagClass {
18public:
19 WeaponBagClass( ArmedGameObj * owner );
20 ~WeaponBagClass( void );
21 bool Save( ChunkSaveClass & csave );
22 bool Load( ChunkLoadClass & cload );
23 bool Is_Weapon_Owned( int weapon_id );
24 bool Is_Ammo_Full( int weapon_id );
25 WeaponClass * Add_Weapon( const WeaponDefinitionClass * def, int rounds = 0, bool give_weapon = true );
26 WeaponClass * Add_Weapon( int id, int rounds = 0, bool give_weapon = true );
27 WeaponClass * Add_Weapon( const char *weapon_name, int rounds = 0, bool give_weapon = true );
28 void Remove_Weapon( int index );
29 void Clear_Weapons( void );
30 int Get_Count( void ) { return WeaponList.Count(); }
31 WeaponClass * Peek_Weapon( int index ) { return WeaponList[ index ]; }
32 WeaponClass * Get_Weapon( void ) { return WeaponList[ WeaponIndex ]; }
33 WeaponClass * Get_Next_Weapon( void );
34 void Import_Weapon_List(BitStreamClass & packet);
35 void Export_Weapon_List(BitStreamClass & packet);
36 void Import_Ammo_List(BitStreamClass & packet);
37 void Export_Ammo_List(BitStreamClass & packet);
38 int Get_Index( void ) { return WeaponIndex; }
39 void Select_Index( int index );
40 void Select_Next( void );
41 void Select_Prev( void );
42 void Select_Key_Number( int key_number );
43 void Select_Weapon( WeaponClass * weapon );
44 void Select_Weapon_ID( int weapon_id );
45 void Select_Weapon_Name( const char * name );
46 void Deselect( void );
47 bool Is_Changed( void ) { return IsChanged; }
48 void Force_Changed( void ) { IsChanged = true; }
49 void Reset_Changed( void ) { IsChanged = false; }
50 bool HUD_Is_Changed( void ) { return HUDIsChanged; }
51 void HUD_Reset_Changed( void ) { HUDIsChanged = false; }
52 bool Move_Contents( WeaponBagClass * source );
53 void Store_Inventory( InventoryClass * );
54 void Owner_Initialized(bool b) {OwnerInitialized = b;}
55 bool Is_Owner_Initialized() {return OwnerInitialized;}
56private:
57
58 ArmedGameObj *Owner; //0
59 DynamicVectorClass<WeaponClass*> WeaponList; //4
60 int WeaponIndex; //1C
61 bool IsChanged; //20
62 bool HUDIsChanged; //21
63 bool OwnerInitialized; //22
64 WeaponClass * Find_Weapon( const WeaponDefinitionClass * def );
65 void Mark_Owner_Dirty( void );
66 bool Should_Skip_Weapon(WeaponClass* weapon);
67}; // 0024
68
69#endif