Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4975 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Aug 9, 2005, 12:23:07 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: player should be able to load its preferences from an external file
removed the obsolete ObjectManager that has been redesigned as FastFactory.

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

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/player.cc

    r4969 r4975  
    5656}
    5757
    58 
    59 /**
    60  *  destructs the player, deletes alocated memory
    61 */
    62 Player::~Player ()
    63 {
    64   /* do not delete the weapons, they are contained in the pnode tree
    65      and will be deleted there.
    66      this only frees the memory allocated to save the list.
    67   */
    68   delete this->weaponMan;
     58/**
     59 * loads a Players information from a specified file.
     60 * @param fileName the name of the File to load the player from (absolute path)
     61 */
     62Player::Player(const char* fileName)
     63{
     64  this->init();
     65  TiXmlDocument doc(fileName);
     66
     67  if(!doc.LoadFile())
     68  {
     69    PRINTF(2)("Loading file %s failed for player.\n", fileName);
     70    return;
     71  }
     72
     73  this->loadParams(doc.RootElement());
    6974}
    7075
     
    96101
    97102  this->weaponMan->changeWeaponConfig(0);
     103}
     104
     105/**
     106 *  destructs the player, deletes alocated memory
     107 */
     108Player::~Player ()
     109{
     110  /* do not delete the weapons, they are contained in the pnode tree
     111  and will be deleted there.
     112  this only frees the memory allocated to save the list.
     113  */
     114  delete this->weaponMan;
    98115}
    99116
  • orxonox/trunk/src/world_entities/player.h

    r4954 r4975  
    2929  public:
    3030    Player();
     31    Player(const char* fileName);
    3132    Player(const TiXmlElement* root);
    3233    virtual ~Player();
  • orxonox/trunk/src/world_entities/weapons/projectile.h

    r4972 r4975  
    2323#include "world_entity.h"
    2424#include "vector.h"
    25 
    26 class ParticleEmitter;
    2725
    2826class Projectile : public WorldEntity
     
    5351
    5452  protected:
    55 
    5653    // energy
    5754    float                 energyMin;
     
    6562
    6663    Vector                velocity;                  //!< velocity of the projectile.
    67 
    68     ParticleEmitter*      emitter;                   //!< For special effects each Projectile has an emitter.
    6964};
    7065
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4972 r4975  
    7171/**
    7272 * This is used as a container for all the different kinds of weapons that may exist
     73 *
     74 * Weapons have certain states, and actions, that can inflict them.
     75 * ex. Action WA_SHOOT leeds to State WS_SHOOTING.
     76 * each action has a sound connected to it,
     77 * each state a time and an animation.
    7378 */
    7479class Weapon : public WorldEntity
Note: See TracChangeset for help on using the changeset viewer.