Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5968 in orxonox.OLD for branches/network/src/world_entities/player.h


Ignore:
Timestamp:
Dec 7, 2005, 4:16:51 PM (18 years ago)
Author:
patrick
Message:

network: merged the trunk into the network with the command svn merge -r5824:HEAD ../trunk network, changes changed… bla bla..

File:
1 edited

Legend:

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

    r5829 r5968  
    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>
    14 class tList;
    15 class Weapon;
    16 class WeaponManager;
    17 class Vector;
    18 class Event;
     11/* Forward Declaration */
     12class Playable;
    1913
    2014//! Basic controllable WorldEntity
     
    2418     the player.cc for debug also
    2519*/
    26 class Player : public WorldEntity, public EventListener
     20class Player : public EventListener
    2721{
    28     friend class World;
    2922
    3023  public:
    3124    Player();
    32     Player(const char* fileName);
    33     Player(const TiXmlElement* root);
    3425    virtual ~Player();
    3526
    36     void init();
    37     void loadParams(const TiXmlElement* root);
     27    bool              setControllable(Playable* controllalble);
     28    inline Playable*  getControllable() { return this->controllable; };
    3829
    39     void addWeapon(Weapon* weapon);
    40     void removeWeapon(Weapon* weapon);
     30    bool              disconnectControllable();
    4131
    42     /* WorldEntity functions */
    43     virtual void postSpawn();
    44     virtual void leftWorld();
    45 
    46     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    47     virtual void tick(float time);
    48     virtual void draw() const;
    49 
    50     virtual void process(const Event &event);
    51 
    52     /* Synchronizeable functions */
    53     virtual void writeBytes(const byte* data, int length);
    54     virtual int readBytes(byte* data);
     32    // eventListener extension.
     33    virtual void      process(const Event &event);
    5534
    5635  private:
    57     void move(float time);
    58     void weaponAction();
     36    void              init();
    5937
    60     /* Synchronizeable functions */
    61     virtual void writeDebug() const;
    62     virtual void readDebug() const;
    63 
    64     // !! temporary !!
    65     void ADDWEAPON();
    6638
    6739  private:
    68     bool                  bUp;                //!< up button pressed.
    69     bool                  bDown;              //!< down button pressed.
    70     bool                  bLeft;              //!< left button pressed.
    71     bool                  bRight;             //!< right button pressed.
    72     bool                  bAscend;            //!< ascend button pressed.
    73     bool                  bDescend;           //!< descend button presses.
    74     bool                  bFire;              //!< fire button pressed.
    75 
    76     WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    77 
    78     Vector                velocity;           //!< the velocity of the player.
    79     float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    80     float                 acceleration;       //!< the acceleration of the player.
    81 
    82     byte*                 inData;
    83     int                   inLength;
    84     int                   inBufferLength;
    85     int                   recLength;
    86     byte*                 outData;
    87     int                   outLength;
    88     int                   outBufferLength;
    89     int                   sentLength;
    90 
     40    Playable*         controllable;                  //!< The one we controll or NULL if none
    9141};
    9242
Note: See TracChangeset for help on using the changeset viewer.