Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.