source:
orxonox.OLD/trunk/src/world_entities/playable.h
@
6781
Last change on this file since 6781 was 6568, checked in by bensch, 19 years ago | |
---|---|
File size: 1.7 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" | |
[6547] | 10 | #include "extendable.h" |
[5838] | 11 | #include "event.h" |
[5876] | 12 | #include <list> |
[5838] | 13 | |
[6444] | 14 | #include "world_entities/weapons/weapon_manager.h" |
[6442] | 15 | |
[5847] | 16 | class Weapon; |
[6444] | 17 | |
[5872] | 18 | class Player; |
[5838] | 19 | |
20 | //! Basic controllable WorldEntity | |
21 | /** | |
[5864] | 22 | * |
[5838] | 23 | */ |
[6547] | 24 | class Playable : public WorldEntity, public Extendable |
[5838] | 25 | { |
26 | public: | |
27 | Playable(); | |
28 | virtual ~Playable(); | |
29 | ||
[6241] | 30 | virtual void enter()=0; |
31 | virtual void leave()=0; | |
[5838] | 32 | |
[6547] | 33 | virtual bool pickup(PowerUp* powerUp); |
34 | ||
[6443] | 35 | void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); |
36 | void removeWeapon(Weapon* weapon); | |
[6444] | 37 | void nextWeaponConfig(); |
38 | void previousWeaponConfig(); | |
[6443] | 39 | |
[5875] | 40 | inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; |
[6568] | 41 | void weaponConfigChanged(); |
[5838] | 42 | |
[6568] | 43 | |
[5895] | 44 | bool subscribePlayer(Player* player); |
[5896] | 45 | bool unsubscribePlayer(Player* player); |
[5895] | 46 | |
[6241] | 47 | void attachCamera(); |
48 | void detachCamera(); | |
49 | ||
[6436] | 50 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
[5898] | 51 | virtual void process(const Event &event) = 0; |
52 | ||
53 | ||
[6222] | 54 | |
[5898] | 55 | /** @return a List of Events in PEV_* sytle */ |
[5877] | 56 | inline const std::list<int>& getEventList() { return this->events; }; |
[5838] | 57 | |
[5877] | 58 | protected: |
59 | void registerEvent(int eventType); | |
[5895] | 60 | void unregisterEvent(int eventType); |
[5872] | 61 | |
[5838] | 62 | private: |
63 | WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping | |
[5898] | 64 | std::list<int> events; //!< A list of Events, that are captured for this playable |
[5886] | 65 | |
[5898] | 66 | Player* currentPlayer; //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL |
[5888] | 67 | |
[5838] | 68 | }; |
69 | ||
70 | #endif /* _PLAYABLE_H */ |
Note: See TracBrowser
for help on using the repository browser.