Changeset 7547 for code/trunk/src/modules/pickup/PickupRepresentation.h
- Timestamp:
- Oct 16, 2010, 12:37:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupRepresentation.h
r7540 r7547 39 39 40 40 #include "core/XMLPort.h" 41 41 42 #include "interfaces/Pickupable.h" 42 43 #include "pickup/PickupIdentifier.h" … … 53 54 /** 54 55 @brief 55 The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentifi fer "PickupIdentifier"). It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.56 The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentifier "PickupIdentifier"). It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like. 56 57 They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager". 57 58 … … 71 72 As you might have noticed, there is a parameter called <em>spawnerTemplate</em> and also another parameter called <em>inventoryRepresentation</em>. Let's first explain the second one, <em>inventoryRepresentation</em>. 72 73 - The <b>inventoryRepresentation</b> specifies the image that is displayed in the PickupInventory for the specific type of @ref orxonox::Pickupable "Pickupable". More technically, it is the name of an image located in the <code>PickupInventory.imageset</code>, which in turn is located in <code>data_extern/gui/imagesets/</code>. 73 - The <b>spawnerTemplate</b> specifies how the type of @ref orxonox::Pickupable "Pickupable" (or more precisely the @ref orxonox::PickupSpawner "PickupSpawner", that spawns that type of @ref orxonox::Pickupable "Pickupable") is displayed ingame. It is a @ref orx nox::Template "Template" defined in XML. The <em>spawnerTemplate</em> can be specified as follows (keep in mind, that the template needs to have been specified before the definition of the PickupRepresentation that uses it).74 - The <b>spawnerTemplate</b> specifies how the type of @ref orxonox::Pickupable "Pickupable" (or more precisely the @ref orxonox::PickupSpawner "PickupSpawner", that spawns that type of @ref orxonox::Pickupable "Pickupable") is displayed ingame. It is a @ref orxonox::Template "Template" defined in XML. The <em>spawnerTemplate</em> can be specified as follows (keep in mind, that the template needs to have been specified before the definition of the PickupRepresentation that uses it). 74 75 @code 75 76 <Template name="awesomePickupRepresentation"> … … 105 106 106 107 /** 108 @brief Get the name of the Pickupable represented by this PickupRepresentation. 109 @return Returns the name. 110 */ 111 inline const std::string& getPickupName(void) const { return this->name_; } // tolua_export 112 /** 113 @brief Get the description of the Pickupable represented by this PickupRepresentation. 114 @return Returns the description. 115 */ 116 inline const std::string& getPickupDescription(void) const { return this->description_; } // tolua_export 117 /** 118 @brief Get the name of spawnerTemplate the Pickupable represented by this PickupRepresentation. 119 @return Returns the name of the spawnerTemplate. 120 */ 121 inline const std::string& getSpawnerTemplate(void) const 122 { return this->spawnerTemplate_; } 123 /** 124 @brief Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupRepresentation looks like. 125 @param index The index. 126 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns NULL. 127 */ 128 inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index) const 129 { if(index == 0) return this->spawnerRepresentation_; return NULL; } 130 /** 131 @brief Get the name of the image representing the pickup in the PickupInventory. 132 @return Returns the name of the image as a string. 133 */ 134 inline const std::string& getInventoryRepresentation(void) const { return this->inventoryRepresentation_; } // tolua_export 135 /** 136 @brief Get the Pickupable represented by this PickupRepresentation. 137 @param index The index. 138 @return Returns (for index = 0) a pointer to the Pickupable. For index > 0 it returns NULL. 139 */ 140 inline const Pickupable* getPickup(unsigned int index) const 141 { if(index == 0) return this->pickup_; return NULL; } 142 143 StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner. 144 145 protected: 146 /** 107 147 @brief Set the name of the Pickupable represented by this PickupRepresentation. 108 148 @param name The name. … … 142 182 inline void setPickup(Pickupable* pickup) 143 183 { this->pickup_ = pickup; } 144 145 /**146 @brief Get the name of the Pickupable represented by this PickupRepresentation.147 @return Returns the name.148 */149 inline const std::string& getPickupName(void) { return this->name_; } // tolua_export150 /**151 @brief Get the description of the Pickupable represented by this PickupRepresentation.152 @return Returns the description.153 */154 inline const std::string& getPickupDescription(void) { return this->description_; } // tolua_export155 /**156 @brief Get the name of spawnerTemplate the Pickupable represented by this PickupRepresentation.157 @return Returns the name of the spawnerTemplate.158 */159 inline const std::string& getSpawnerTemplate(void)160 { return this->spawnerTemplate_; }161 /**162 @brief Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupRepresentation looks like.163 @param index The index.164 @return Returns (for index = 0) a pointer to the StaticEntity. For index > 0 it returns NULL.165 */166 inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index)167 { if(index == 0) return this->spawnerRepresentation_; return NULL; }168 /**169 @brief Get the name of the image representing the pickup in the PickupInventory.170 @return Returns the name of the image as a string.171 */172 inline const std::string& getInventoryRepresentation(void) { return this->inventoryRepresentation_; } // tolua_export173 /**174 @brief Get the Pickupable represented by this PickupRepresentation.175 @param index The index.176 @return Returns (for index = 0) a pointer to the Pickupable. For index > 0 it returns NULL.177 */178 inline const Pickupable* getPickup(unsigned int index)179 { if(index == 0) return this->pickup_; return NULL; }180 181 StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner.182 184 183 185 private:
Note: See TracChangeset
for help on using the changeset viewer.