Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6177 was 6162, checked in by bensch, 19 years ago

orxonox/trunk: merged the spaceshipcontroll branche into the trunk
merged with command
svn merge -r6036:HEAD spaceshipcontrol/ ../trunk/
no conflicts

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