Changeset 4833 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons
- Timestamp:
- Jul 11, 2005, 5:46:05 PM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4832 r4833 32 32 WeaponManager::WeaponManager(int nrOfSlots) 33 33 { 34 this->setClassID(CL_WEAPON_MANAGER, "WeaponManager"); 35 36 for(int i = 0; i < W_MAX_CONFIGS; ++i) 37 { 38 this->configs[i].bUsed = false; 39 for(int j = 0; j < W_MAX_SLOTS; ++j) 40 this->configs[i].slots[j] = NULL; 41 } 34 this->init(); 42 35 this->nrOfSlots = nrOfSlots; 43 this->currConfID = W_CONFIG0; 44 } 45 46 36 } 37 38 39 /** 40 * Destroys a WeaponManager 41 */ 47 42 WeaponManager::~WeaponManager() 48 43 { … … 60 55 } 61 56 57 void WeaponManager::init() 58 { 59 this->setClassID(CL_WEAPON_MANAGER, "WeaponManager"); 60 61 for(int i = 0; i < W_MAX_CONFIGS; ++i) 62 { 63 this->configs[i].bUsed = false; 64 for(int j = 0; j < W_MAX_SLOTS; ++j) 65 this->configs[i].slots[j] = NULL; 66 } 67 this->currConfID = W_CONFIG0; 68 69 } 62 70 63 71 /** … … 162 170 * @param second passed since last tick 163 171 */ 164 void WeaponManager::tick(float sec)172 void WeaponManager::tick(float dt) 165 173 { 166 174 Weapon* w; … … 168 176 { 169 177 w = this->configs[this->currConfID].slots[i]; 170 if( w != NULL) w->tick( sec);178 if( w != NULL) w->tick(dt); 171 179 } 172 180 } … … 182 190 { 183 191 w = this->configs[this->currConfID].slots[i]; 184 if( w != NULL) w->draw(); 192 if( w != NULL) 193 w->draw(); 185 194 } 186 195 } -
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4832 r4833 56 56 57 57 //! this is a weapon Configuration: it has up to 8 slots 58 typedef struct weaponConfig { 58 typedef struct weaponConfig 59 { 59 60 bool bUsed; //!< is set to true, if this configuration is 60 61 Weapon* slots[8]; … … 76 77 77 78 void fire(); 78 void tick(float sec);79 void tick(float dt); 79 80 void draw(); 80 81
Note: See TracChangeset
for help on using the changeset viewer.