Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2009, 9:40:35 PM (16 years ago)
Author:
landauf
Message:

added two new functions to Gametype

Location:
code/branches/miniprojects/src/orxonox/objects/worldentities/pawns
Files:
2 edited

Legend:

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

    r2768 r2818  
    133133    }
    134134
     135    void Pawn::setPlayer(PlayerInfo* player)
     136    {
     137        ControllableEntity::setPlayer(player);
     138
     139        if (this->getGametype())
     140            this->getGametype()->playerStartsControllingPawn(player, this);
     141    }
     142
     143    void Pawn::removePlayer()
     144    {
     145        if (this->getGametype())
     146            this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
     147
     148        ControllableEntity::removePlayer();
     149    }
     150
    135151    void Pawn::setHealth(float health)
    136152    {
  • code/branches/miniprojects/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2662 r2818  
    4747            virtual void tick(float dt);
    4848            void registerVariables();
     49
     50            virtual void setPlayer(PlayerInfo* player);
     51            virtual void removePlayer();
    4952
    5053            inline bool isAlive() const
Note: See TracChangeset for help on using the changeset viewer.