Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/player.h @ 4670

Last change on this file since 4670 was 4404, checked in by patrick, 19 years ago

orxonox/trunk: player now is a EventListener for particular events

File size: 2.0 KB
RevLine 
[3471]1/*!
2    \file player.h
3    \brief Implements a basic controllable WorldEntity
4*/
5
6#ifndef _PLAYER_H
7#define _PLAYER_H
8
9#include "world_entity.h"
[4382]10#include "physics_interface.h"
[4404]11#include "event_listener.h"
[3471]12
[3583]13template<class T> class tList;
14class Weapon;
[3873]15class WeaponManager;
[3608]16class Vector;
[3620]17class World;
[4404]18class Event;
[3471]19
20//! Basic controllable WorldEntity
[4404]21class Player : public WorldEntity, public PhysicsInterface, public EventListener
[3471]22{
23  friend class World;
24 
25 public:
[3620]26  Player();
[4261]27  Player(const TiXmlElement* root);
[3531]28  virtual ~Player();
[3583]29
30  void addWeapon(Weapon* weapon);
31  void removeWeapon(Weapon* weapon);
[3471]32 
33  virtual void postSpawn();
[3583]34  virtual void leftWorld();
[3578]35  virtual void hit(WorldEntity* weapon, Vector* loc);
[3471]36  virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
[3583]37
38  virtual void tick(float time); 
39  virtual void draw();
40
[3471]41  virtual void command(Command* cmd);
[4404]42
43  virtual void process(const Event &event);
[3471]44 
45 private:
46  bool bUp;              //!< up button pressed.
47  bool bDown;            //!< down button pressed.
48  bool bLeft;            //!< left button pressed.
49  bool bRight;           //!< right button pressed.
50  bool bAscend;          //!< ascend button pressed.
51  bool bDescend;         //!< descend button presses.
52  bool bFire;            //!< fire button pressed.
[3585]53  bool bWeaponChange;    //!< weapon change button pressed
[3471]54
[3583]55  tList<Weapon>* weapons;//!< a list of weapon
[3585]56  Weapon* activeWeapon;  //!< the weapon that is currenty activated
[3755]57  Weapon* activeWeaponL;  //temporary -- FIX THIS
[3873]58  WeaponManager* weaponMan; //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
[3755]59
[3620]60  World* myWorld;        //!< reference to the world object
[3583]61
[3608]62  Vector* velocity;       //!< the velocity of the player.
[3471]63  float travelSpeed;     //!< the current speed of the player (to make soft movement)
64  float acceleration;    //!< the acceleration of the player.
65 
66  void move(float time);
[3620]67  void weapon(void);
[3471]68 
69};
70
71#endif /* _PLAYER_H */
Note: See TracBrowser for help on using the repository browser.