Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2005, 1:05:10 PM (19 years ago)
Author:
bensch
Message:

branches/powerups: merged the trunk to branches/powerup
merged with commandsvn merge ../trunk/ powerups/ -r5848:HEAD
conflicts resolved in favor of the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/world_entities/player.h

    r5500 r5955  
    77#define _PLAYER_H
    88
    9 #include "world_entity.h"
    10 #include "physics_interface.h"
    119#include "event_listener.h"
    1210
    13 template<class T> class tList;
    14 class Weapon;
    15 class WeaponManager;
    16 class Vector;
    17 class Event;
     11/* Forward Declaration */
     12class Playable;
    1813
    1914//! Basic controllable WorldEntity
     
    2318     the player.cc for debug also
    2419*/
    25 class Player : public WorldEntity, public EventListener
     20class Player : public EventListener
    2621{
    27   friend class World;
    2822
    2923  public:
    3024    Player();
    31     Player(const char* fileName);
    32     Player(const TiXmlElement* root);
    3325    virtual ~Player();
    3426
    35     void init();
    36     void loadParams(const TiXmlElement* root);
     27    bool              setControllable(Playable* controllalble);
     28    inline Playable*  getControllable() { return this->controllable; };
    3729
    38     void addWeapon(Weapon* weapon);
    39     void removeWeapon(Weapon* weapon);
     30    bool              disconnectControllable();
    4031
    41     virtual void postSpawn();
    42     virtual void leftWorld();
     32    // eventListener extension.
     33    virtual void      process(const Event &event);
    4334
    44     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    45     virtual void tick(float time);
    46     virtual void draw() const;
    47 
    48     virtual void process(const Event &event);
     35  private:
     36    void              init();
    4937
    5038
    5139  private:
    52     void move(float time);
    53     void weaponAction();
    54 
    55     // !! temporary !!
    56     void ADDWEAPON();
    57 
    58   private:
    59     bool                  bUp;                //!< up button pressed.
    60     bool                  bDown;              //!< down button pressed.
    61     bool                  bLeft;              //!< left button pressed.
    62     bool                  bRight;             //!< right button pressed.
    63     bool                  bAscend;            //!< ascend button pressed.
    64     bool                  bDescend;           //!< descend button presses.
    65     bool                  bFire;              //!< fire button pressed.
    66 
    67     WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    68 
    69     Vector                velocity;           //!< the velocity of the player.
    70     float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    71     float                 acceleration;       //!< the acceleration of the player.
     40    Playable*         controllable;                  //!< The one we controll or NULL if none
    7241};
    7342
Note: See TracChangeset for help on using the changeset viewer.