Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

huge pipeline

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