Changeset 2221 for code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
- Timestamp:
- Nov 19, 2008, 11:50:03 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r2196 r2221 26 26 * 27 27 */ 28 28 29 /** 30 @file PlayerTrigger.h 31 @brief 32 Definition of the PlayerTrigger class. 33 */ 34 29 35 #ifndef _PlayerTrigger_H__ 30 36 #define _PlayerTrigger_H__ 37 38 #include "OrxonoxPrereqs.h" 31 39 32 40 #include "Trigger.h" … … 36 44 /** 37 45 @brief 38 46 A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it. 39 47 @author 40 48 Damian 'Mozork' Frick … … 46 54 virtual ~PlayerTrigger(); 47 55 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML. 49 57 58 /** 59 @brief Returns the player that triggered the PlayerTrigger. 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 */ 50 62 inline ControllableEntity* getTriggeringPlayer(void) const 51 63 { return this->player_; } 64 65 /** 66 @brief Checks whether the PlayerTrigger normally returns a ControllableEntity. 67 @return Returns true if the PlayerTrigger normally returns a ControllableEntity. 68 */ 69 inline bool isForPlayer(void) const 70 { return this->isForPlayer_; } 52 71 53 72 protected: 54 73 virtual bool isTriggered(TriggerMode mode) = 0; 55 74 75 /** 76 @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger. 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 */ 56 79 inline void setTriggeringPlayer(ControllableEntity* player) 57 80 { this->player_ = player; } 58 inline bool isForPlayer(void) const 59 { return this->isForPlayer_; } 81 82 /** 83 @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities. 84 @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not. 85 */ 60 86 inline void setForPlayer(bool isForPlayer) 61 87 { this->isForPlayer_ = isForPlayer; } 62 88 63 89 private: 64 ControllableEntity* player_; 65 bool isForPlayer_; 90 ControllableEntity* player_; //!< The player that triggered the PlayerTrigger. 91 bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities. 66 92 67 93 };
Note: See TracChangeset
for help on using the changeset viewer.