Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/powerups/src/world_entities/playable.h @ 6109

Last change on this file since 6109 was 5955, checked in by bensch, 19 years ago

branches/powerups: merged the trunk to branches/powerup
merged with commandsvn merge ../trunk/ powerups/ -r5848:HEAD
conflicts resolved in favor of the trunk

File size: 1.3 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
13class Weapon;
14class WeaponManager;
15class Player;
16
17//! Basic controllable WorldEntity
18/**
19 *
20 */
21class Playable : public WorldEntity
22{
23  public:
24    Playable();
25    virtual ~Playable();
26
27
28    virtual void addWeapon(Weapon* weapon )  {}//= 0;
29    virtual void removeWeapon(Weapon* weapon) {}//= 0;
30    inline WeaponManager* getWeaponManager() const { return this->weaponMan; };
31
32    bool subscribePlayer(Player* player);
33    bool unsubscribePlayer(Player* player);
34
35    virtual void process(const Event &event) = 0;
36
37
38    /** @return a List of Events in PEV_* sytle */
39    inline const std::list<int>& getEventList() { return this->events; };
40
41  protected:
42    void registerEvent(int eventType);
43    void unregisterEvent(int eventType);
44
45  private:
46    void init();
47
48  private:
49    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
50    std::list<int>        events;             //!< A list of Events, that are captured for this playable
51
52    Player*               currentPlayer;      //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL
53
54};
55
56#endif /* _PLAYABLE_H */
Note: See TracBrowser for help on using the repository browser.