| 
                Last change
                  on this file since 5886 was
                  5886,
                  checked in by bensch, 20 years ago
           | 
        
        
          | 
               
orxonox/branches/spaceshipcontroll: events need to include less 
 
           | 
        
        | 
            File size:
            1.1 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 |  | 
|---|
 | 27 |     void init(); | 
|---|
 | 28 |  | 
|---|
| [5875] | 29 |     virtual void addWeapon(Weapon* weapon )  {}//= 0; | 
|---|
 | 30 |     virtual void removeWeapon(Weapon* weapon) {}//= 0; | 
|---|
 | 31 |     inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; | 
|---|
| [5838] | 32 |  | 
|---|
| [5872] | 33 |     void subscribeEvents(Player* player); | 
|---|
| [5875] | 34 |     virtual void process(const Event &event) {} //= 0; | 
|---|
 | 35 |     virtual void setKeySet() {}; | 
|---|
| [5877] | 36 |     inline const std::list<int>& getEventList() { return this->events; }; | 
|---|
| [5838] | 37 |  | 
|---|
| [5877] | 38 |   protected: | 
|---|
 | 39 |     void registerEvent(int eventType); | 
|---|
| [5872] | 40 |  | 
|---|
| [5838] | 41 |   private: | 
|---|
 | 42 |  | 
|---|
 | 43 |     WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping | 
|---|
| [5877] | 44 |     std::list<int>        events; | 
|---|
| [5886] | 45 |  | 
|---|
 | 46 |     Player*               currentPlayer; | 
|---|
| [5864] | 47 |     //todo: add a event to id mapping list | 
|---|
| [5838] | 48 | }; | 
|---|
 | 49 |  | 
|---|
 | 50 | #endif /* _PLAYABLE_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.