Changeset 5898 in orxonox.OLD for branches/spaceshipcontrol
- Timestamp:
- Dec 3, 2005, 5:37:17 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/playable.cc
r5896 r5898 38 38 } 39 39 40 /** 41 * initializes this Playable 42 */ 40 43 void Playable::init() 41 44 { 42 45 this->setClassID(CL_PLAYABLE, "Playable"); 43 46 PRINTF(4)("PLAYABLE INIT\n"); 47 44 48 this->weaponMan = new WeaponManager(this); 45 49 50 // the reference to the Current Player is NULL, because we dont have one at the beginning. 46 51 this->currentPlayer = NULL; 47 52 } … … 49 54 /** 50 55 * subscribe to all events the controllable needs 56 * @param player the player that shall controll this Playable 51 57 */ 52 58 bool Playable::subscribePlayer(Player* player) … … 71 77 72 78 /** 73 * subscribe to all events the controllable needs 79 * unsubscribe from all events the controllable needs 80 * @param player the Player, that controlled this Ship. 74 81 */ 75 82 bool Playable::unsubscribePlayer(Player* player) … … 95 102 96 103 /** 97 * add an event to the event list 104 * add an event to the event list of events this Playable can capture 105 * @param eventType the Type of event to add 98 106 */ 99 107 void Playable::registerEvent(int eventType) … … 106 114 107 115 /** 108 * add an event to the event list 116 * remove an event to the event list this Playable can capture. 117 * @param event the event to unregister. 109 118 */ 110 119 void Playable::unregisterEvent(int eventType) -
branches/spaceshipcontrol/src/world_entities/playable.h
r5896 r5898 25 25 virtual ~Playable(); 26 26 27 void init();28 27 29 28 virtual void addWeapon(Weapon* weapon ) {}//= 0; … … 34 33 bool unsubscribePlayer(Player* player); 35 34 36 virtual void process(const Event &event) {} //= 0; 35 virtual void process(const Event &event) = 0; 36 37 38 /** @return a List of Events in PEV_* sytle */ 37 39 inline const std::list<int>& getEventList() { return this->events; }; 38 40 … … 42 44 43 45 private: 46 void init(); 44 47 48 private: 45 49 WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping 46 std::list<int> events; 50 std::list<int> events; //!< A list of Events, that are captured for this playable 47 51 48 Player* currentPlayer; 52 Player* currentPlayer; //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL 49 53 50 54 };
Note: See TracChangeset
for help on using the changeset viewer.