Changeset 6442 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 8, 2006, 5:19:39 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r6436 r6442 25 25 Playable::Playable() 26 26 { 27 this->init(); 27 this->setClassID(CL_PLAYABLE, "Playable"); 28 PRINTF(4)("PLAYABLE INIT\n"); 29 30 this->toList(OM_GROUP_01); 31 this->weaponMan = new WeaponManager(this); 32 33 // the reference to the Current Player is NULL, because we dont have one at the beginning. 34 this->currentPlayer = NULL; 28 35 } 29 36 … … 39 46 } 40 47 41 /**42 * initializes this Playable43 */44 void Playable::init()45 {46 this->setClassID(CL_PLAYABLE, "Playable");47 PRINTF(4)("PLAYABLE INIT\n");48 49 this->toList(OM_GROUP_01);50 this->weaponMan = new WeaponManager(this);51 52 // the reference to the Current Player is NULL, because we dont have one at the beginning.53 this->currentPlayer = NULL;54 }55 48 56 49 /** -
trunk/src/world_entities/playable.h
r6436 r6442 10 10 #include "event.h" 11 11 #include <list> 12 12 13 13 14 class Weapon; … … 51 52 52 53 private: 53 void init();54 55 private:56 54 WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping 57 55 std::list<int> events; //!< A list of Events, that are captured for this playable -
trunk/src/world_entities/player.cc
r6441 r6442 59 59 this->controllable = controllable; 60 60 this->hud.setEnergyWidget(this->controllable->getEnergyWidget()); 61 this->hud.setWeaponManager(this->controllable->getWeaponManager()); 61 62 return true; 62 63 } … … 73 74 this->controllable = NULL; 74 75 this->hud.setEnergyWidget(NULL); 76 this->hud.setWeaponManager(NULL); 75 77 return true; 76 78 } -
trunk/src/world_entities/weapons/weapon_manager.h
r6142 r6442 54 54 55 55 void setSlotCount(unsigned int slotCount); 56 unsigned int getSlotCount() const { return this->slotCount; }; 56 57 // setting up the WeaponManager with the following functions 57 58 void setSlotPosition(int slot, const Vector& position); … … 69 70 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 70 71 void removeWeapon(Weapon* weapon, int configID = -1); 72 Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID].currentWeapon: NULL; }; 71 73 72 74 // FIXME ::
Note: See TracChangeset
for help on using the changeset viewer.