Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6809 was 6804, checked in by bensch, 19 years ago

trunk: remastered Playables a bit

File size: 1.8 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 "extendable.h"
11#include "event.h"
12#include <list>
13
14#include "world_entities/weapons/weapon_manager.h"
15
16class Weapon;
17
18class Player;
19
20//! Basic controllable WorldEntity
21/**
22 *
23 */
24class Playable : public WorldEntity, public Extendable
25{
26  public:
27    virtual ~Playable();
28
29    virtual void enter()=0;
30    virtual void leave()=0;
31
32    virtual bool pickup(PowerUp* powerUp);
33
34    void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
35    void removeWeapon(Weapon* weapon);
36    void nextWeaponConfig();
37    void previousWeaponConfig();
38
39    inline WeaponManager* getWeaponManager() const { return this->weaponMan; };
40    void weaponConfigChanged();
41
42
43    bool subscribePlayer(Player* player);
44    bool unsubscribePlayer(Player* player);
45
46    void attachCamera();
47    void detachCamera();
48
49    virtual void collidesWith(WorldEntity* entity, const Vector& location);
50    virtual void process(const Event &event);
51
52    virtual void tick(float dt);
53
54    /** @return a List of Events in PEV_* sytle */
55    inline const std::list<int>& getEventList() { return this->events; };
56
57  protected:
58    Playable();
59
60    void registerEvent(int eventType);
61    void unregisterEvent(int eventType);
62
63  private:
64    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
65    std::list<int>        events;             //!< A list of Events, that are captured for this playable
66
67    Player*               currentPlayer;      //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL
68
69    bool                  bFire;              //!< If the Ship is firing.
70
71};
72
73#endif /* _PLAYABLE_H */
Note: See TracBrowser for help on using the repository browser.