Changeset 9348 for code/trunk/src/orxonox/interfaces/Pickupable.h
- Timestamp:
- Aug 30, 2012, 11:08:17 PM (12 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 .project 1 2 build 2 3 codeblocks 4 dependencies 3 5 vs 4 dependencies
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
code/trunk/src/orxonox/interfaces/Pickupable.h
r8866 r9348 53 53 Pickups (@ref orxonox::Pickupable "Pickupables") are objects that (quite unsurprisingly) can be picked up. Additionally they can be used and unused (transition from used to not used), and also dropped. 54 54 55 A class of Pickups can incorporate many different types of pickups (see @ref orxonox::PickupIdentifier "PickupIdentifier"), each type is uniquely defined by a @ref orxonox::PickupIdentifier "PickupIdentifier". Each pickup has such an identifier identiying its type. This means that two pickups of the same type have identifiers which are equal.56 57 55 @author 58 56 Damian 'Mozork' Frick … … 69 67 public: 70 68 virtual ~Pickupable(); //!< Default destructor. 69 70 //! @brief Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup. 71 virtual const std::string& getRepresentationName() const = 0; 71 72 72 73 /** … … 136 137 bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this Pickupable. 137 138 138 Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.139 /**140 @brief Creates a duplicate of the input OrxonoxClass.141 This method needs to be implemented by any Class inheriting from Pickupable.142 @param item A reference to a pointer to the OrxonoxClass that is to be duplicated.143 */144 virtual void clone(OrxonoxClass*& item) {}145 146 /**147 @brief Get the PickupIdentifier of this Pickupable.148 @return Returns a pointer to the PickupIdentifier of this Pickupable.149 */150 virtual const PickupIdentifier* getPickupIdentifier(void) const151 { return this->pickupIdentifier_; }152 153 139 bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input. 154 140 bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up. … … 158 144 159 145 protected: 160 /**161 @brief Helper method to initialize the PickupIdentifier.162 */163 void initializeIdentifier(void) {}164 165 146 virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed. 166 147 virtual void destroyPickup(void); //!< Destroys a Pickupable. … … 174 155 175 156 /** 157 @brief Check whether the Pickupable is in the process of being destroyed. 158 @return Returns true if so. 159 */ 160 inline bool isBeingDestroyed(void) 161 { return this->beingDestroyed_; } 162 163 /** 176 164 @brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 177 This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.: 178 DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance); 165 This method must be implemented by any class directly inheriting from Pickupable. 179 166 @return Returns true if a spawner was created, false if not. 180 167 */ 181 168 virtual bool createSpawner(void) = 0; 182 183 PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.184 169 185 170 private: … … 203 188 //! SUPER functions. 204 189 SUPER_FUNCTION(10, Pickupable, changedUsed, false); 205 SUPER_FUNCTION(12, Pickupable, changedCarrier, false); 206 SUPER_FUNCTION(13, Pickupable, changedPickedUp, false); 207 SUPER_FUNCTION(11, Pickupable, clone, false); 190 SUPER_FUNCTION(11, Pickupable, changedCarrier, false); 191 SUPER_FUNCTION(12, Pickupable, changedPickedUp, false); 208 192 } 209 193
Note: See TracChangeset
for help on using the changeset viewer.