source:
orxonox.OLD/trunk/src/world_entities/playable.h
@
6255
Last change on this file since 6255 was 6241, checked in by bensch, 19 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[5838] | 1 | |
2 | /*! | |
3 | * @file playable.h | |
4 | * Interface for a basic controllable WorldEntity | |
5 | */ | |
6 | #ifndef _PLAYABLE_H | |
7 | #define _PLAYABLE_H | |
8 | ||
9 | #include "world_entity.h" | |
10 | #include "event.h" | |
[5876] | 11 | #include <list> |
[5838] | 12 | |
[5847] | 13 | class Weapon; |
[5838] | 14 | class WeaponManager; |
[5872] | 15 | class Player; |
[5838] | 16 | |
17 | //! Basic controllable WorldEntity | |
18 | /** | |
[5864] | 19 | * |
[5838] | 20 | */ |
21 | class Playable : public WorldEntity | |
22 | { | |
23 | public: | |
24 | Playable(); | |
25 | virtual ~Playable(); | |
26 | ||
[6241] | 27 | virtual void enter()=0; |
28 | virtual void leave()=0; | |
[5838] | 29 | |
[5875] | 30 | virtual void addWeapon(Weapon* weapon ) {}//= 0; |
31 | virtual void removeWeapon(Weapon* weapon) {}//= 0; | |
32 | inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; | |
[5838] | 33 | |
[5895] | 34 | bool subscribePlayer(Player* player); |
[5896] | 35 | bool unsubscribePlayer(Player* player); |
[5895] | 36 | |
[6241] | 37 | void attachCamera(); |
38 | void detachCamera(); | |
39 | ||
[5898] | 40 | virtual void process(const Event &event) = 0; |
41 | ||
42 | ||
[6222] | 43 | |
[5898] | 44 | /** @return a List of Events in PEV_* sytle */ |
[5877] | 45 | inline const std::list<int>& getEventList() { return this->events; }; |
[5838] | 46 | |
[5877] | 47 | protected: |
48 | void registerEvent(int eventType); | |
[5895] | 49 | void unregisterEvent(int eventType); |
[5872] | 50 | |
[5838] | 51 | private: |
[5898] | 52 | void init(); |
[5838] | 53 | |
[5898] | 54 | private: |
[5838] | 55 | WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping |
[5898] | 56 | std::list<int> events; //!< A list of Events, that are captured for this playable |
[5886] | 57 | |
[5898] | 58 | Player* currentPlayer; //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL |
[5888] | 59 | |
[5838] | 60 | }; |
61 | ||
62 | #endif /* _PLAYABLE_H */ |
Note: See TracBrowser
for help on using the repository browser.