Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6985 in orxonox.OLD


Ignore:
Timestamp:
Feb 2, 2006, 4:09:46 PM (18 years ago)
Author:
bensch
Message:

trunk: rename of setControllable

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/network_game_manager.cc

    r6959 r6985  
    701701  PRINTF(0)("uniqueID = %d\n", s->getUniqueID());
    702702
    703   player->setControllable(p);
     703  player->setPlayable(p);
    704704
    705705
  • trunk/src/story_entities/game_world_data.cc

    r6984 r6985  
    230230  {
    231231    playable = dynamic_cast<Playable*>(playableList->front());
    232     this->localPlayer->setControllable(playable);
     232    this->localPlayer->setPlayable(playable);
    233233  }
    234234
  • trunk/src/story_entities/multi_player_world_data.cc

    r6634 r6985  
    179179      {
    180180        playable = dynamic_cast<Playable*>(playableList->front());
    181         this->localPlayer->setControllable(playable);
     181        this->localPlayer->setPlayable(playable);
    182182      }
    183183    }
     
    250250  {
    251251    playable = dynamic_cast<Playable*>(playableList->front());
    252     this->localPlayer->disconnectControllable();
    253     this->localPlayer->setControllable(playable);
     252    this->localPlayer->disconnectPlayable();
     253    this->localPlayer->setPlayable(playable);
    254254    this->toggle = !this->toggle;
    255255  }
     
    257257  {
    258258    playable = dynamic_cast<Playable*>(playableList->back());
    259     this->localPlayer->disconnectControllable();
    260     this->localPlayer->setControllable(playable);
     259    this->localPlayer->disconnectPlayable();
     260    this->localPlayer->setPlayable(playable);
    261261    this->toggle = !this->toggle;
    262262  }
    263263
    264264
    265   Playable* pl = this->localPlayer->getControllable();
     265  Playable* pl = this->localPlayer->getPlayable();
    266266  PRINTF(0)("The current regisered playable is hid: %i\n", pl->getUniqueID());
    267267
  • trunk/src/world_entities/player.cc

    r6700 r6985  
    3737  PRINTF(4)("PLAYER INIT\n");
    3838
    39   this->controllable = NULL;
     39  this->playable = NULL;
    4040  this->hud.show();
    4141
     
    5353
    5454
    55 bool Player::setControllable(Playable* controllable)
     55bool Player::setPlayable(Playable* playable)
    5656{
    57   if(controllable != NULL && controllable->subscribePlayer(this))
     57  if(playable != NULL && playable->subscribePlayer(this))
    5858  {
    59       this->controllable = controllable;
    60       this->hud.setEnergyWidget(this->controllable->getHealthWidget());
    61       this->hud.setWeaponManager(this->controllable->getWeaponManager());
     59      this->playable = playable;
     60      this->hud.setEnergyWidget(this->playable->getHealthWidget());
     61      this->hud.setWeaponManager(this->playable->getWeaponManager());
    6262      return true;
    6363  }
     
    6666}
    6767
    68 bool Player::disconnectControllable()
     68bool Player::disconnectPlayable()
    6969 {
    70    if(this->controllable == NULL) return true;
     70   if(this->playable == NULL) return true;
    7171
    72    if(this->controllable->unsubscribePlayer(this))
     72   if(this->playable->unsubscribePlayer(this))
    7373   {
    74      this->controllable = NULL;
     74     this->playable = NULL;
    7575     this->hud.setEnergyWidget(NULL);
    7676     this->hud.setWeaponManager(NULL);
     
    9696       list<BaseObject*>::const_iterator node;
    9797       for (node = objectList->begin(); node != objectList->end(); node++)
    98          if (this->controllable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->controllable->getAbsCoor()).len() < 10.0)
     98         if (this->playable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < 10.0)
    9999       {
    100100
    101          this->disconnectControllable();
    102          this->setControllable(dynamic_cast<Playable*>(*node));
     101         this->disconnectPlayable();
     102         this->setPlayable(dynamic_cast<Playable*>(*node));
    103103
    104104         break;
     
    107107   }
    108108
    109    if (likely(this->controllable != NULL))
    110      this->controllable->process(event);
     109   if (likely(this->playable != NULL))
     110     this->playable->process(event);
    111111 }
    112112
  • trunk/src/world_entities/player.h

    r6871 r6985  
    11/*!
    22 * @file player.h
    3  * Implements a basic controllable WorldEntity
     3 * Implements a basic playable WorldEntity
    44 */
    55
     
    1515
    1616
    17 //! Basic controllable WorldEntity
     17//! Basic playable WorldEntity
    1818/**
    1919  *  this is the debug player - actualy we would have to make a new
     
    2828    virtual ~Player();
    2929
    30     bool              setControllable(Playable* controllalble);
    31     inline Playable*  getControllable() { return this->controllable; };
    32     bool              disconnectControllable();
     30    bool              setPlayable(Playable* controllalble);
     31    inline Playable*  getPlayable() { return this->playable; };
     32    bool              disconnectPlayable();
    3333
    3434    void              weaponConfigChanged();
     
    3838
    3939  private:
    40     Playable*         controllable;                  //!< The one we controll or NULL if none
     40    Playable*         playable;                  //!< The one we controll or NULL if none
    4141    Hud               hud;                           //!< The HUD to be displayed for this Player.
    4242};
Note: See TracChangeset for help on using the changeset viewer.