Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 16, 2010, 12:37:09 PM (14 years ago)
Author:
dafrick
Message:

Documenting and cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/PickupRepresentation.h

    r7540 r7547  
    3939
    4040#include "core/XMLPort.h"
     41
    4142#include "interfaces/Pickupable.h"
    4243#include "pickup/PickupIdentifier.h"
     
    5354    /**
    5455    @brief
    55         The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentififer "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.
    5657        They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager".
    5758
     
    7172        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>.
    7273        - 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 orxnox::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).
    7475        @code
    7576        <Template name="awesomePickupRepresentation">
     
    105106
    106107            /**
     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            /**
    107147            @brief Set the name of the Pickupable represented by this PickupRepresentation.
    108148            @param name The name.
     
    142182            inline void setPickup(Pickupable* pickup)
    143183                { 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_export
    150             /**
    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_export
    155             /**
    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_export
    173             /**
    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.
    182184
    183185        private:
Note: See TracChangeset for help on using the changeset viewer.