Changeset 8667 for code/branches/presentation/src/orxonox/interfaces
- Timestamp:
- May 29, 2011, 6:44:45 PM (13 years ago)
- Location:
- code/branches/presentation/src/orxonox/interfaces
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/interfaces/InterfaceCompilation.cc
r8637 r8667 59 59 RegisterRootObject(PlayerTrigger); 60 60 61 this->player_ = NULL;62 61 this->isForPlayer_ = false; 63 62 } -
code/branches/presentation/src/orxonox/interfaces/PlayerTrigger.h
r7601 r8667 40 40 #include "core/OrxonoxClass.h" 41 41 42 #include "infos/PlayerInfo.h" 43 #include "worldentities/pawns/Pawn.h" 44 42 45 namespace orxonox 43 46 { 44 47 /** 45 48 @brief 46 PlayerTrigger is an interface if implemented by a specific trigger can be used to recover the Player (or more preciselythe @ref orxonox::Pawn "Pawn") that triggered it.49 PlayerTrigger is an interface if implemented by a specific trigger can be used to recover the Player (or the @ref orxonox::Pawn "Pawn") that triggered it. 47 50 48 51 @author … … 58 61 59 62 /** 60 @brief Returns the playerthat triggered the PlayerTrigger.63 @brief Returns the Pawn that triggered the PlayerTrigger. 61 64 @return Returns a pointer to the Pawn that triggered the PlayerTrigger. 62 65 */ 63 inline Pawn* getTriggeringPlayer(void) const 66 inline Pawn* getTriggeringPawn(void) const 67 { return this->pawn_.get(); } 68 69 /** 70 @brief Returns the player that triggered the PlayerTrigger. 71 @return Returns a pointer to the PlayerInfo that triggered the PlayerTrigger. 72 */ 73 inline PlayerInfo* getTriggeringPlayer(void) const 64 74 { return this->player_; } 65 75 66 76 /** 67 @brief Checks whether the PlayerTrigger normally returns a Pawn .68 @return Returns true if the PlayerTrigger normally returns a Pawn .77 @brief Checks whether the PlayerTrigger normally returns a Pawn/PlayerInfo. 78 @return Returns true if the PlayerTrigger normally returns a Pawn/PlayerInfo. 69 79 */ 70 80 inline bool isForPlayer(void) const … … 76 86 @param player A pointer to the Pawn that triggered the PlayerTrigger. 77 87 */ 78 inline void setTriggeringP layer(Pawn* player)79 { this->player_ = player; }88 inline void setTriggeringPawn(Pawn* pawn) 89 { assert(pawn); this->player_ = WeakPtr<PlayerInfo>(pawn->getPlayer()); this->pawn_ = WeakPtr<Pawn>(pawn); } 80 90 81 91 /** … … 87 97 88 98 private: 89 Pawn* player_; //!< The player that triggered the PlayerTrigger. 99 WeakPtr<PlayerInfo> player_; //!< The player that triggered the PlayerTrigger. 100 WeakPtr<Pawn> pawn_; //!< The Pawn that triggered the PlayerTrigger. 90 101 bool isForPlayer_; //!< Is true when the PlayerTrigger should be set to normally be triggered by Pawns. 91 102
Note: See TracChangeset
for help on using the changeset viewer.