12#ifndef TT_INCLUDE_WEAPONBAGCLASS_H
13#define TT_INCLUDE_WEAPONBAGCLASS_H
14#include "ArmedGameObj.h"
15class WeaponDefinitionClass;
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;}
59 DynamicVectorClass<WeaponClass*> WeaponList;
63 bool OwnerInitialized;
64 WeaponClass * Find_Weapon(
const WeaponDefinitionClass * def );
65 void Mark_Owner_Dirty(
void );
66 bool Should_Skip_Weapon(WeaponClass* weapon);