Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2012, 10:36:24 PM (12 years ago)
Author:
landauf
Message:

removed PickupIdentifier for a number of reasons (I talked to Damian about it before)
a pickup now references the PickupRepresentation by name with the "representation" attribute

File:
1 edited

Legend:

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

    r9302 r9318  
    4141
    4242#include "interfaces/Pickupable.h"
    43 #include "pickup/PickupIdentifier.h"
    4443#include "worldentities/StaticEntity.h"
    4544
     
    5453    /**
    5554    @brief
    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.
     55        The PickupRepresentation class represents a specific pickup type. It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.
    5756        They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager".
    5857
     
    6463            spawnerTemplate = "awesomePickupRepresentation"
    6564            inventoryRepresentation = "AwesomePickup"
    66         >
    67             <pickup>
    68                 <SomePickup />
    69             </pickup>
    70         </PickupRepresentation>
     65        />
    7166        @endcode
    7267        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>.
     
    133128            */
    134129            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; }
     130
     131            virtual void changedName();
    142132
    143133            StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner.
     
    168158            @param representation A pointer to the StaticEntity that is the spawnerRepresentation of this PickupRepresentation.
    169159            */
    170             inline void setSpawnerRepresentation(StaticEntity* representation)
    171                 { this->spawnerRepresentation_ = representation; }
     160            void setSpawnerRepresentation(StaticEntity* representation);
     161
    172162            /**
    173163            @brief Set the image representing the pickup in the PickupInventory.
     
    176166            inline void setInventoryRepresentation(const std::string& image)
    177167                { this->inventoryRepresentation_ = image; }
    178             /**
    179             @brief Set the Pickupable that is represented by this PickupRepresentation.
    180             @param pickup A pointer to the Pickupable.
    181             */
    182             inline void setPickup(Pickupable* pickup)
    183                 { this->pickup_ = pickup; }
    184168
    185169        private:
     
    195179            std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory.
    196180
    197             Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation.
    198 
    199181    }; // tolua_export
    200182
Note: See TracChangeset for help on using the changeset viewer.