Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2009, 5:42:50 PM (16 years ago)
Author:
landauf
Message:

Cleaned up setPlayer/removePlayer interface between PlayerInfo and ControllableEntity. The whole control is now up to the PlayerInfo, the respective functions in ControllableEntity are now protected.

Location:
code/trunk/src/orxonox/objects/worldentities/pawns
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r3033 r3038  
    209209                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
    210210
    211             if (this->getPlayer())
    212                 this->getPlayer()->stopControl(this);
     211            if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
     212                this->getPlayer()->stopControl();
    213213
    214214            if (GameMode::isMaster())
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2826 r3038  
    4747            virtual void tick(float dt);
    4848            void registerVariables();
    49 
    50             virtual void setPlayer(PlayerInfo* player);
    51             virtual void removePlayer();
    5249
    5350            inline bool isAlive() const
     
    113110
    114111        protected:
     112            virtual void setPlayer(PlayerInfo* player);
     113            virtual void removePlayer();
     114
    115115            virtual void death();
    116116            virtual void deatheffect();
  • code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h

    r2662 r3038  
    4646            virtual void tick(float dt);
    4747
    48             virtual void setPlayer(PlayerInfo* player);
    49             virtual void startLocalHumanControl();
    50 
    5148            virtual void moveFrontBack(const Vector2& value);
    5249            virtual void moveRightLeft(const Vector2& value);
     
    5956            virtual void fire(WeaponMode::Enum fireMode);
    6057            virtual void greet();
     58
     59        protected:
     60            virtual void setPlayer(PlayerInfo* player);
     61            virtual void startLocalHumanControl();
    6162
    6263        private:
Note: See TracChangeset for help on using the changeset viewer.