Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2005, 7:23:37 PM (18 years ago)
Author:
snellen
Message:

disconnectControllable() in player.cc implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/world_entities/player.cc

    r5899 r5901  
    5353
    5454
    55 
    56 void Player::process(const Event &event)
    57 {
    58   if (likely(this->controllable != NULL))
    59     this->controllable->process(event);
    60 }
    61 
    62 
    6355bool Player::setControllable(Playable* controllable)
    6456{
     
    7264}
    7365
     66bool Player::disconnectControllable()
     67 {
     68   if(this->controllable == NULL) return true;
    7469
     70   if(this->controllable->unsubscribePlayer(this))
     71   {
     72     this->controllable = NULL;
     73     return true;
     74   }
     75   else
     76     return false;
     77 }
     78
     79 void Player::process(const Event &event)
     80 {
     81   if (likely(this->controllable != NULL))
     82     this->controllable->process(event);
     83 }
     84
Note: See TracChangeset for help on using the changeset viewer.