Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5898 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 3, 2005, 5:37:17 PM (19 years ago)
Author:
bensch
Message:

controll documentation

Location:
branches/spaceshipcontrol/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/world_entities/playable.cc

    r5896 r5898  
    3838}
    3939
     40/**
     41 * initializes this Playable
     42 */
    4043void Playable::init()
    4144{
    4245  this->setClassID(CL_PLAYABLE, "Playable");
    4346  PRINTF(4)("PLAYABLE INIT\n");
     47
    4448  this->weaponMan = new WeaponManager(this);
    4549
     50  // the reference to the Current Player is NULL, because we dont have one at the beginning.
    4651  this->currentPlayer = NULL;
    4752}
     
    4954/**
    5055 * subscribe to all events the controllable needs
     56 * @param player the player that shall controll this Playable
    5157 */
    5258bool Playable::subscribePlayer(Player* player)
     
    7177
    7278/**
    73  * subscribe to all events the controllable needs
     79 * unsubscribe from all events the controllable needs
     80 * @param player the Player, that controlled this Ship.
    7481 */
    7582bool Playable::unsubscribePlayer(Player* player)
     
    95102
    96103/**
    97  * add an event to the event list
     104 * add an event to the event list of events this Playable can capture
     105 * @param eventType the Type of event to add
    98106 */
    99107void Playable::registerEvent(int eventType)
     
    106114
    107115/**
    108  * add an event to the event list
     116 * remove an event to the event list this Playable can capture.
     117 * @param event the event to unregister.
    109118 */
    110119void Playable::unregisterEvent(int eventType)
  • branches/spaceshipcontrol/src/world_entities/playable.h

    r5896 r5898  
    2525    virtual ~Playable();
    2626
    27     void init();
    2827
    2928    virtual void addWeapon(Weapon* weapon )  {}//= 0;
     
    3433    bool unsubscribePlayer(Player* player);
    3534
    36     virtual void process(const Event &event) {} //= 0;
     35    virtual void process(const Event &event) = 0;
     36
     37
     38    /** @return a List of Events in PEV_* sytle */
    3739    inline const std::list<int>& getEventList() { return this->events; };
    3840
     
    4244
    4345  private:
     46    void init();
    4447
     48  private:
    4549    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    46     std::list<int>        events;
     50    std::list<int>        events;             //!< A list of Events, that are captured for this playable
    4751
    48     Player*               currentPlayer;
     52    Player*               currentPlayer;      //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL
    4953
    5054};
Note: See TracChangeset for help on using the changeset viewer.