/*! * @file playable.h * Interface for a basic controllable WorldEntity */ #ifndef _PLAYABLE_H #define _PLAYABLE_H #include "world_entity.h" #include "event.h" #include class Weapon; class WeaponManager; class Player; //! Basic controllable WorldEntity /** * */ class Playable : public WorldEntity { public: Playable(); virtual ~Playable(); void init(); virtual void addWeapon(Weapon* weapon ) {}//= 0; virtual void removeWeapon(Weapon* weapon) {}//= 0; inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; void subscribeEvents(Player* player); virtual void process(const Event &event) {} //= 0; virtual void setKeySet() {}; inline const std::list& getEventList() { return this->events; }; protected: void registerEvent(int eventType); private: WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping std::list events; //todo: add a event to id mapping list }; #endif /* _PLAYABLE_H */