Last change
on this file since 6479 was
6444,
checked in by bensch, 19 years ago
|
trunk: sliders get updated, as they should be
|
File size:
1.6 KB
|
Line | |
---|
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" |
---|
11 | #include <list> |
---|
12 | |
---|
13 | #include "world_entities/weapons/weapon_manager.h" |
---|
14 | |
---|
15 | class Weapon; |
---|
16 | |
---|
17 | class Player; |
---|
18 | |
---|
19 | //! Basic controllable WorldEntity |
---|
20 | /** |
---|
21 | * |
---|
22 | */ |
---|
23 | class Playable : public WorldEntity |
---|
24 | { |
---|
25 | public: |
---|
26 | Playable(); |
---|
27 | virtual ~Playable(); |
---|
28 | |
---|
29 | virtual void enter()=0; |
---|
30 | virtual void leave()=0; |
---|
31 | |
---|
32 | void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); |
---|
33 | void removeWeapon(Weapon* weapon); |
---|
34 | void nextWeaponConfig(); |
---|
35 | void previousWeaponConfig(); |
---|
36 | |
---|
37 | inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; |
---|
38 | |
---|
39 | bool subscribePlayer(Player* player); |
---|
40 | bool unsubscribePlayer(Player* player); |
---|
41 | |
---|
42 | void attachCamera(); |
---|
43 | void detachCamera(); |
---|
44 | |
---|
45 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
46 | virtual void process(const Event &event) = 0; |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | /** @return a List of Events in PEV_* sytle */ |
---|
51 | inline const std::list<int>& getEventList() { return this->events; }; |
---|
52 | |
---|
53 | protected: |
---|
54 | void registerEvent(int eventType); |
---|
55 | void unregisterEvent(int eventType); |
---|
56 | |
---|
57 | private: |
---|
58 | WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping |
---|
59 | std::list<int> events; //!< A list of Events, that are captured for this playable |
---|
60 | |
---|
61 | Player* currentPlayer; //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL |
---|
62 | |
---|
63 | }; |
---|
64 | |
---|
65 | #endif /* _PLAYABLE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.