Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 16, 2005, 10:38:04 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/weaponSystem: cleanup WorldEntity and Player (or at least started cleaning up)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/weaponSystem/src/world_entities/player.cc

    r4836 r4877  
    2323
    2424#include "weapon_manager.h"
    25 #include "weapon.h"
    2625#include "test_gun.h"
    2726#include "world.h"
    2827
    2928#include "list.h"
    30 #include "stdincl.h"
    3129
    3230#include "event_handler.h"
    3331
    34 #include "projectile.h"
    3532#include "event.h"
    3633
     
    4138
    4239/**
    43  *  creates a new Player
     40 * creates a new Player
    4441 * @param isFree if the player is free
    4542*/
    4643Player::Player()
    4744{
    48   /*
    49     this is the debug player - actualy we would have to make a new
    50      class derivated from Player for each player. for now, we just use
    51      the player.cc for debug also
    52   */
    5345  this->init();
    5446
     
    7567  delete this->weaponMan;
    7668}
    77 
    7869
    7970/**
     
    119110
    120111/**
    121  *
     112 * loads the Settings of a Player from an XML-element.
    122113 * @param root the XML-element to load the Player's properties from
    123114 */
     
    132123
    133124/**
    134  *  adds a weapon to the weapon list of player
     125 * adds a weapon to the weapon list of player
    135126 * @param weapon to add
    136127*/
     
    219210void Player::tick (float time)
    220211{
    221   //printf("%p\n", this);
    222   //this->getRelCoor().debug();
    223 
    224   /* link tick to weapon */
    225   //this->activeWeapon->tick(time);
    226   //this->activeWeaponL->tick(time); //FIX FIX DELETE REMOVE
    227   this->weaponMan->tick(time);
    228212  // player controlled movement
    229213  this->move(time);
     214
     215  this->weaponMan->tick(time);
    230216  // weapon system manipulation
    231   this->weapon();
     217  this->weaponAction();
    232218}
    233219
     
    266252 *  weapon manipulation by the player
    267253*/
    268 void Player::weapon()
     254void Player::weaponAction()
    269255{
    270256  if( this->bFire)
     
    277263      this->bWeaponChange = false;
    278264    }
    279 }
    280 
    281 
    282 /**
    283  *  The connection to the command node
    284  * @param cmd the Command unit from witch to map
    285 
    286    here the commands are mapped to the players movement/weaponary
    287 */
    288 void Player::command (Command* cmd)
    289 {
    290   PRINTF(3)("recieved command [%s]\n", cmd->cmd);
    291   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp;
    292   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp;
    293   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp;
    294   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp;
    295   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp;
    296   if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
    297265}
    298266
Note: See TracChangeset for help on using the changeset viewer.