Last change
on this file since 5892 was
5888,
checked in by snellen, 19 years ago
|
player.cc and player.h updated ( in ../src/world_entities)
|
File size:
1.0 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 | class Weapon; |
---|
14 | class WeaponManager; |
---|
15 | class Player; |
---|
16 | |
---|
17 | //! Basic controllable WorldEntity |
---|
18 | /** |
---|
19 | * |
---|
20 | */ |
---|
21 | class Playable : public WorldEntity |
---|
22 | { |
---|
23 | public: |
---|
24 | Playable(); |
---|
25 | virtual ~Playable(); |
---|
26 | |
---|
27 | void init(); |
---|
28 | |
---|
29 | virtual void addWeapon(Weapon* weapon ) {}//= 0; |
---|
30 | virtual void removeWeapon(Weapon* weapon) {}//= 0; |
---|
31 | inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; |
---|
32 | |
---|
33 | void subscribeEvents(Player* player); |
---|
34 | virtual void process(const Event &event) {} //= 0; |
---|
35 | inline const std::list<int>& getEventList() { return this->events; }; |
---|
36 | |
---|
37 | protected: |
---|
38 | void registerEvent(int eventType); |
---|
39 | |
---|
40 | private: |
---|
41 | |
---|
42 | WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping |
---|
43 | std::list<int> events; |
---|
44 | |
---|
45 | Player* currentPlayer; |
---|
46 | |
---|
47 | }; |
---|
48 | |
---|
49 | #endif /* _PLAYABLE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.