Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2012, 11:08:17 PM (12 years ago)
Author:
landauf
Message:

merged branch presentation2012merge back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/pickup/PickupCollection.h

    r8351 r9348  
    5050        The PickupCollection combines different @ref orxonox::Pickupable "Pickupables" (more precisely @ref orxonox::CollectiblePickup "CollectiblePickups") to a coherent, single pickup and makes them seem (from the outside looking in) just as if they were just one @ref orxonox::Pickupable "Pickupable".
    5151
    52         To differentiate between different types of @ref orxonox::PickupCollection "PickupCollections" (just as we differentiate between different types of @ref orxonox::Pickupable "Pickupables") we define a new identifyer called the @ref orxonox::PickupCollectionIdentifier "PickupCollectionIdentifier" which has pretty much the same properties as the @ref orxonox::PickupIdentifier "PickupIdentifier" but extende to @ref orxonox::PickupCollection "PickupCollections".
    53 
    5452        A PickupCollection can be created in XML as follows:
    5553        @code
     
    8179            virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
    8280
    83             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input pickup.
    84 
    8581            virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
    8682
    87             virtual const PickupIdentifier* getPickupIdentifier(void) const; //!< Get the PickupIdentifier of this PickupCollection.
     83            inline void setRepresentationName(const std::string& name)
     84                { this->representationName_ = name; }
     85            virtual const std::string& getRepresentationName() const
     86                { return this->representationName_; }
    8887
    8988            bool addPickupable(CollectiblePickup* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
    9089            const Pickupable* getPickupable(unsigned int index) const; //!< Get the Pickupable at the given index.
     90            bool removePickupable(CollectiblePickup* pickup); //!< Removes the input Pickupable from the list of Pickupables in this PickupCollection.
     91
     92            inline const std::list<CollectiblePickup*>& getPickups() const
     93                { return this->pickups_; }
    9194
    9295            void pickupChangedUsed(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
     
    9598
    9699        protected:
    97             void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
    98 
    99100            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    100 
    101             PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
    102101
    103102        private:
    104103            void changedUsedAction(void); //!< Helper method.
    105104            void changedPickedUpAction(void); //!< Helper method.
     105            void pickupsChanged(void); //!< Helper method.
    106106
    107             std::vector<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
    108 
    109             unsigned int usedCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are in use.
    110             unsigned int pickedUpCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are picked up.
    111             unsigned int disabledCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are disabled.
     107            std::string representationName_; //!< The name of the associated PickupRepresentation.
     108            std::list<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
    112109
    113110            bool processingUsed_; //!< Boolean to ensure, that the PickupCollection doesn't update its used status while its internal state is inconsistent.
Note: See TracChangeset for help on using the changeset viewer.