Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Mar 16, 2005, 11:08:33 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: some changes in the character_attributes, projectile and weapon.

File:
1 edited

Legend:

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

    r3578 r3583  
    2020//#include "collision.h"
    2121#include "objModel.h"
     22#include "list.h"
     23#include "weapon.h"
    2224
    2325using namespace std;
     
    3032{
    3133  this->model = new OBJModel("../data/models/reaplow.obj");
     34  this->weapons = new tList<Weapon>();
    3235}
    3336
     
    3740Player::~Player ()
    3841{
    39 
    40 }
     42  Weapon* w = this->weapons->enumerate();
     43  while( w != NULL)
     44    {
     45      delete w;
     46      w = this->weapons->nextElement();
     47    }
     48  delete this->weapons;
     49}
     50
     51
     52/**
     53   \brief adds a weapon to the weapon list of player
     54   \param weapon to add
     55*/
     56void Player::addWeapon(Weapon* weapon)
     57{
     58  this->weapons->add(weapon);
     59}
     60
     61
     62/**
     63   \brief removes a weapon from the player
     64   \param weapon to remove
     65*/
     66void Player::removeWeapon(Weapon* weapon)
     67{
     68  this->weapons->remove(weapon);
     69}
     70
    4171
    4272/**
Note: See TracChangeset for help on using the changeset viewer.