Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6556 was 6547, checked in by bensch, 19 years ago

orxonox/trunk: merged the WeaponManager back to the trunk

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