Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2043 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Jun 30, 2004, 8:38:43 PM (20 years ago)
Author:
patrick
Message:

orxonox/tunk/src: extended worldentity, added doxygen comments, added class ability (empty)

Location:
orxonox/trunk/src
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r2036 r2043  
    66
    77bin_PROGRAMS=orxonox
    8 orxonox_SOURCES=orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc
     8orxonox_SOURCES=orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc vector.cc ability.cc
    99
    1010#  uncomment the following if bencoder requires the math library
  • orxonox/trunk/src/Makefile.in

    r2036 r2043  
    117117#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
    118118bin_PROGRAMS = orxonox
    119 orxonox_SOURCES = orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc
     119orxonox_SOURCES = orxonox.cc world.cc environment.cc player.cc npc.cc input_output.cc data_tank.cc ai.cc shoot_laser.cc shoot_rocket.cc world_entity.cc synchronisable.cc list.cc vector.cc ability.cc
    120120subdir = src
    121121ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    130130        input_output.$(OBJEXT) data_tank.$(OBJEXT) ai.$(OBJEXT) \
    131131        shoot_laser.$(OBJEXT) shoot_rocket.$(OBJEXT) \
    132         world_entity.$(OBJEXT) synchronisable.$(OBJEXT) list.$(OBJEXT)
     132        world_entity.$(OBJEXT) synchronisable.$(OBJEXT) list.$(OBJEXT) \
     133        vector.$(OBJEXT) ability.$(OBJEXT)
    133134orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    134135orxonox_LDADD = $(LDADD)
     
    139140depcomp = $(SHELL) $(top_srcdir)/depcomp
    140141am__depfiles_maybe = depfiles
    141 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/data_tank.Po \
    142 @AMDEP_TRUE@    ./$(DEPDIR)/environment.Po \
     142@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ability.Po ./$(DEPDIR)/ai.Po \
     143@AMDEP_TRUE@    ./$(DEPDIR)/data_tank.Po ./$(DEPDIR)/environment.Po \
    143144@AMDEP_TRUE@    ./$(DEPDIR)/input_output.Po ./$(DEPDIR)/list.Po \
    144145@AMDEP_TRUE@    ./$(DEPDIR)/npc.Po ./$(DEPDIR)/orxonox.Po \
    145146@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/shoot_laser.Po \
    146147@AMDEP_TRUE@    ./$(DEPDIR)/shoot_rocket.Po \
    147 @AMDEP_TRUE@    ./$(DEPDIR)/synchronisable.Po ./$(DEPDIR)/world.Po \
    148 @AMDEP_TRUE@    ./$(DEPDIR)/world_entity.Po
     148@AMDEP_TRUE@    ./$(DEPDIR)/synchronisable.Po ./$(DEPDIR)/vector.Po \
     149@AMDEP_TRUE@    ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
    149150CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    150151        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    199200        -rm -f *.tab.c
    200201
     202@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ability.Po@am__quote@
    201203@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@
    202204@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@
     
    210212@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shoot_rocket.Po@am__quote@
    211213@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synchronisable.Po@am__quote@
     214@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    212215@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@
    213216@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world_entity.Po@am__quote@
  • orxonox/trunk/src/world_entity.cc

    r2036 r2043  
    2020#include "world_entity.h"
    2121
     22#include "vector.h"
     23
    2224using namespace std;
    2325
    2426
     27/**
     28   \brief
     29   \param v:
     30   \return
     31*/
     32
     33/**
     34   \brief Constructor
     35
     36   This Constructor initializises the all WorldEntities. Everything, that is a part of the game-world is a child of WorldEntity. This class implements empty functions for all sort of operation a WorldEntity has to or can implement.
     37This is some sort of standard interface to all WorldEntities...
     38*/
    2539WorldEntity::WorldEntity ()
    2640{
     
    3246WorldEntity::~WorldEntity () {}
    3347
     48/**
     49   \brief sets the position of this entity
     50   \param position: Vector, pointing (from 0,0,0) to the new position
     51*/
     52void WorldEntity::setPosition(Vector* position) {}
    3453
    35 /*void WorldEntity::setPosition( Vector position ) {} */
    36 /* Vector*  void getPosition() {} */
     54/**
     55   \brief gets the postion of this entity
     56   \return a Vector, pointing (from 0,0,0) to the new position
     57*/
     58Vector* getPosition() {}
    3759
    38 void WorldEntity::setOrientation(/* Vector orientation*/) {}
    39 /* Vector* */ void WorldEntity::getOrientation() {}
     60/**
     61   \brief sets orientation of this entity
     62   \param orientation: vector specifying in which direction the entity looks
     63*/
     64void WorldEntity::setOrientation(Vector* orientation) {}
    4065
     66/**
     67   \brief gets orientation of this entity
     68   \return vector specifying in which direction the entity looks
     69*/
     70Vector* WorldEntity::getOrientation() {}
     71
     72/**
     73   \brief sets the speed of the entity, if any
     74   \param speed: the speed in points (openGL points) per seconds
     75*/
    4176void WorldEntity::setSpeed(float speed)
    4277{
     
    4479}
    4580
     81/**
     82   \brief gets the speed of the entity, if any
     83   \return the speed in points (openGL points) per seconds
     84*/
    4685float WorldEntity::getSpeed()
    4786{
     
    4988}
    5089
     90/**
     91   \brief sets the health of the entity
     92   \param health: number for the life count, normaly {0..100}
     93*/
    5194void WorldEntity::setHealth(float health)
    5295{
     
    5497}
    5598
     99/**
     100   \brief gets the health of the entity
     101   \return number for the life count, normaly {0..100}
     102*/
    56103float WorldEntity::getHealth()
    57104{
     
    59106}
    60107
     108/**
     109   \brief this method is called every tick
     110   \param time: the time since start of the world
    61111
    62 void WorldEntity::tick(float dt)
     112   This function is called before every repaint of the world, to update every time dependent variable of the entity. If the entity moves, it has to calculate the new position every tick here in this function. Do not use this for animations.
     113*/
     114void WorldEntity::tick(float time)
    63115{}
    64116
     117/**
     118   \brief the entity is painted to the screen with this function
     119
     120   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
     121*/
    65122void WorldEntity::paint()
    66123{
     
    69126
    70127/* virtual void WorldEntity::actionEvent(Event* event); */
    71 void WorldEntity::collide(WorldEntity* we /*, Vector n */)
    72 {}
     128/**
     129   \brief this function is called, when two entities collide
     130   \param we: the world entity, with whom it collides
     131   \param loc: place where the collision happens
     132*/
     133void WorldEntity::collide(WorldEntity* we, Vector loc) {}
    73134
    74 void WorldEntity::hurt()
    75 {}
     135/**
     136   \brief this function is called, when the ship is hit by a waepon
     137   \param weapon: the laser/rocket/shoot that hits.
     138   \param loc: place where it is hit
    76139
    77 void WorldEntity::destroy()
    78 {}
     140   calculate the damage depending
     141*/
     142void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
     143
     144/**
     145   \brief this function is called, if the entity is to be destroied
     146   
     147   This can be called, if eg. something realy bad happens :)
     148*/
     149void WorldEntity::destroy() {}
     150
     151/**
     152   \brief this function is automatically called before the entity enters the world
     153*/
     154void WorldEntity::entityPreEnter() {}
     155
     156/**
     157   \brief this function is automatically called after the entity enters the world
     158
     159*/
     160void WorldEntity::entityPostEnter() {}
     161
     162/**
     163   \brief this function is automatically called before the entity quits the world
     164
     165*/
     166void WorldEntity::entityPreQuit() {}
     167
     168/**
     169   \brief this function is automatically called after the entity quits the world
     170*/
     171void WorldEntity::entityPostQuit() {}
  • orxonox/trunk/src/world_entity.h

    r2036 r2043  
    55#include "data_tank.h"
    66
     7class Vector;
     8class Ability;
    79
    810class WorldEntity {
     
    1315
    1416
    15   /*void setPosition( Vector position );*/
    16   /* Vector*  void getPosition();*/
    17   void setOrientation(/* Vector orientation*/);
    18   /* Vector* */ void getOrientation();
     17  void setPosition(Vector* position);
     18  Vector* getPosition();
     19  void setOrientation(Vector* orientation);
     20  Vector* getOrientation();
     21  void setSpawnPoint(Vector* place);
    1922  void setSpeed(float speed);
    2023  float getSpeed();
     
    2225  float getHealth();
    2326
    24   void addAbility();
    25   void removeAbility();
     27  void addAbility(Ability* ability);
     28  void removeAbility(Ability* ability);
    2629
    27   virtual void tick(float dt);
     30  virtual void tick(float time);
    2831  virtual void paint();
    2932  /* virtual void actionEvent(Event* event); */
    30   virtual void collide(WorldEntity* we /*, Vector n */);
    31   virtual void hurt();
     33  virtual void collide(WorldEntity* we, Vector loc);
     34  virtual void hit(WorldEntity* weapon, Vector loc);
    3235  virtual void destroy();
    3336
     37  virtual void entityPreEnter();
     38  virtual void entityPostEnter();
     39  virtual void entityPreQuit();
     40  virtual void entityPostQuit();
     41
     42 
     43
    3444 private:
    35   /* Vector* position; */
    36   /* Vector* orientation; */
     45  Vector* position;
     46  Vector* orientation;
    3747  /* List of abilities */
    3848  float health;
    3949  float speed;
     50  /* entity can be in the air or at ground: */
     51  int airGround;
     52
    4053 
    4154
Note: See TracChangeset for help on using the changeset viewer.