Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entity.h @ 2104

Last change on this file since 2104 was 2077, checked in by patrick, 20 years ago

/orxonox/trunk/src: making doxygen comments in worldentity, player, world; extending API of worldentity; inserting list.h in world - this version does not compile

File size: 1.9 KB
RevLine 
[2077]1/*!
2    \file world_entity.h
3    \brief A base class for all objects in the world
4   
5    This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions.
6*/ 
[2036]7
[2077]8
9
[2036]10#ifndef WORLD_ENTITY_H
11#define WORLD_ENTITY_H
12
13#include "data_tank.h"
14
[2043]15class Vector;
16class Ability;
[2036]17
[2077]18//! WorldEntity
19/**
20  A base class for all objects in the world
21
22  This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions.
23*/
[2036]24class WorldEntity {
25
26 public:
27  WorldEntity ();
28  ~WorldEntity ();
29
30
[2043]31  void setPosition(Vector* position);
32  Vector* getPosition();
33  void setOrientation(Vector* orientation);
34  Vector* getOrientation();
35  void setSpawnPoint(Vector* place);
[2036]36  void setSpeed(float speed);
37  float getSpeed();
38  void setHealth(float health);
39  float getHealth();
40
[2043]41  void addAbility(Ability* ability);
42  void removeAbility(Ability* ability);
[2036]43
[2077]44  virtual void tick(float dt);
[2036]45  virtual void paint();
46  /* virtual void actionEvent(Event* event); */
[2043]47  virtual void collide(WorldEntity* we, Vector loc);
48  virtual void hit(WorldEntity* weapon, Vector loc);
[2036]49  virtual void destroy();
50
[2043]51  virtual void entityPreEnter();
52  virtual void entityPostEnter();
53  virtual void entityPreQuit();
54  virtual void entityPostQuit();
55
56 
57
[2036]58 private:
[2077]59  Vector* position;    //!< position of the entity
60  Vector* orientation; //!< orientation of the entity
[2036]61  /* List of abilities */ 
[2077]62  float health; //!< health of the entity, if any
63  float speed; //!< speed of the entity if any
[2043]64  /* entity can be in the air or at ground: */
[2077]65  int airGround; //!< is it air or bound to the ground (ground=0, air=1)
[2043]66
[2036]67 
68
69};
70
71#endif
Note: See TracBrowser for help on using the repository browser.