Changeset 5875 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities
- Timestamp:
- Dec 2, 2005, 3:33:46 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/playable.cc
r5872 r5875 14 14 */ 15 15 16 #include "weapon _manager.h"16 #include "weapons/weapon_manager.h" 17 17 #include "playable.h" 18 #include "event_handler.h" 19 #include "player.h" 18 20 19 21 … … 23 25 } 24 26 25 Playable::init() 27 Playable::~Playable() 28 { 29 30 } 31 32 void Playable::init() 26 33 { 27 34 this->setClassID(CL_PLAYABLE, "Playable"); … … 36 43 { 37 44 /*EventHandler*/ 38 evh = EventHandler::getInstance();45 EventHandler* evh = EventHandler::getInstance(); 39 46 for (int i = 0 ; i < events.size(); i++) 40 47 { 41 if (!evh->isSubscribed(ES_GAME, i))42 evh->subscribe(this, ES_GAME, i);43 }48 if (!evh->isSubscribed(ES_GAME, i)) 49 evh->subscribe(player, ES_GAME, i); 50 } 44 51 45 52 } 46 47 Playable::getWeaponManager()48 {49 return weaponMan;50 } -
branches/spaceshipcontrol/src/world_entities/playable.h
r5872 r5875 21 21 class Playable : public WorldEntity 22 22 { 23 24 23 public: 25 24 Playable(); … … 29 28 void loadParams(const TiXmlElement* root); 30 29 31 virtual void addWeapon(Weapon* weapon ) = 0;32 virtual void removeWeapon(Weapon* weapon) = 0;33 WeaponManager* getWeaponManager();30 virtual void addWeapon(Weapon* weapon ) {}//= 0; 31 virtual void removeWeapon(Weapon* weapon) {}//= 0; 32 inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; 34 33 35 34 void subscribeEvents(Player* player); 36 virtual void process(const Event &event) = 0;37 virtual void setKeySet() ;35 virtual void process(const Event &event) {} //= 0; 36 virtual void setKeySet() {}; 38 37 inline const std::list<Event*>& getEventList() { return this->events; }; 39 38 -
branches/spaceshipcontrol/src/world_entities/player.cc
r5872 r5875 16 16 #include "player.h" 17 17 18 #include "factory.h"19 20 #include "list.h"21 22 18 #include "event_handler.h" 23 24 19 #include "event.h" 25 20
Note: See TracChangeset
for help on using the changeset viewer.