Changeset 5968 in orxonox.OLD for branches/network/src/world_entities/player.h
- Timestamp:
- Dec 7, 2005, 4:16:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/player.h
r5829 r5968 7 7 #define _PLAYER_H 8 8 9 #include "world_entity.h"10 #include "physics_interface.h"11 9 #include "event_listener.h" 12 10 13 template<class T> 14 class tList; 15 class Weapon; 16 class WeaponManager; 17 class Vector; 18 class Event; 11 /* Forward Declaration */ 12 class Playable; 19 13 20 14 //! Basic controllable WorldEntity … … 24 18 the player.cc for debug also 25 19 */ 26 class Player : public WorldEntity, publicEventListener20 class Player : public EventListener 27 21 { 28 friend class World;29 22 30 23 public: 31 24 Player(); 32 Player(const char* fileName);33 Player(const TiXmlElement* root);34 25 virtual ~Player(); 35 26 36 void init();37 void loadParams(const TiXmlElement* root);27 bool setControllable(Playable* controllalble); 28 inline Playable* getControllable() { return this->controllable; }; 38 29 39 void addWeapon(Weapon* weapon); 40 void removeWeapon(Weapon* weapon); 30 bool disconnectControllable(); 41 31 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); 55 34 56 35 private: 57 void move(float time); 58 void weaponAction(); 36 void init(); 59 37 60 /* Synchronizeable functions */61 virtual void writeDebug() const;62 virtual void readDebug() const;63 64 // !! temporary !!65 void ADDWEAPON();66 38 67 39 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 91 41 }; 92 42
Note: See TracChangeset
for help on using the changeset viewer.