Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/playable.h @ 6442

Last change on this file since 6442 was 6442, checked in by bensch, 18 years ago

Gui Shows weapons (simple)

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