Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 14, 2009, 1:44:19 PM (16 years ago)
Author:
rgrieder
Message:

Merged pickup branch revisions to pickup2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2/src/orxonox/pickup/PickupCollection.h

    r5781 r5947  
    4747{
    4848    /**
    49         @brief PickupCollection for organising items.
    50         @author Daniel 'Huty' Haggenmueller
     49    @brief PickupCollection for organising items.
     50    @author Daniel 'Huty' Haggenmueller
    5151    */
    5252    class _OrxonoxExport PickupCollection
    5353    {
    54     public:
    55         PickupCollection();
     54        public:
     55            //TODO: Should probably be derived from OrxonoxClass???
     56            PickupCollection();
    5657
    57         bool add(BaseItem* item);       //!< Add an item to the collection.
     58            bool add(BaseItem* item);       //!< Add an item to the collection.
    5859
    59         bool checkSlot(BaseItem* item); //!< Check if there's a free slot in the collection for an item.
     60            bool checkSlot(BaseItem* item); //!< Check if there's a free slot in the collection for an item.
    6061
    61         void clear();                   //!< Empty the collection
    62         bool contains(BaseItem* item, bool anyOfType = false);                      //!< Check if the collection contains an item.
     62            void clear();                   //!< Empty the collection
     63            bool contains(BaseItem* item, bool anyOfType = false);                      //!< Check if the collection contains an item.
    6364
    64         void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
     65            void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
    6566
    66         void useItem();                                                             //!< Use the first usable item.
    67         void useItem(UsableItem* item);                                             //!< Use a usable item.
     67            //TODO: What's up with that?
     68            void useItem();                                                             //!< Use the first usable item.
     69            void useItem(UsableItem* item);                                             //!< Use a usable item.
    6870
    69         void addAdditiveModifier(ModifierType::Value type, float value);             //!< Add an additive modifier.
    70         void addMultiplicativeModifier(ModifierType::Value type, float value);       //!< Add a multiplicative modifier.
     71            //TODO: This really shouldn't be here. It's nbot the Collections business to know about stuff like that.
     72            void addAdditiveModifier(ModifierType::Value type, float value);             //!< Add an additive modifier.
     73            void addMultiplicativeModifier(ModifierType::Value type, float value);       //!< Add a multiplicative modifier.
    7174
    72         float getAdditiveModifier(ModifierType::Value type);                         //!< Get total additive modifier.
    73         float getMultiplicativeModifier(ModifierType::Value type);                   //!< Get total multiplicative modifier.
     75            float getAdditiveModifier(ModifierType::Value type);                         //!< Get total additive modifier.
     76            float getMultiplicativeModifier(ModifierType::Value type);                   //!< Get total multiplicative modifier.
    7477
    75         void removeAdditiveModifier(ModifierType::Value type, float value);          //!< Remove an additive modifier.
    76         void removeMultiplicativeModifier(ModifierType::Value type, float value);    //!< Remove a multiplicative modifier.
     78            void removeAdditiveModifier(ModifierType::Value type, float value);          //!< Remove an additive modifier.
     79            void removeMultiplicativeModifier(ModifierType::Value type, float value);    //!< Remove a multiplicative modifier.
    7780
    78         float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false);        //!< Apply the modifiers to a float.
    79         Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false);    //!< Apply the modifiers to a Vector3.
     81            float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false);        //!< Apply the modifiers to a float.
     82            Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false);    //!< Apply the modifiers to a Vector3.
    8083
    81         /**
    82             @brief Get the map of contained items.
    83             @return The map of items.
    84         */
    85         std::multimap<std::string, BaseItem*> getItems() const
    86             { return this->items_; }
     84            /**
     85                @brief Get the map of contained items.
     86                @return The map of items.
     87            */
     88            std::multimap<std::string, BaseItem*> getItems() const
     89                { return this->items_; }
    8790
    88         /**
    89             @brief Get the owner of the PickupCollection.
    90             @return Returns the pawn which owns the PickupCollection.
    91         */
    92         inline Pawn* getOwner() const
    93             { return this->owner_; }
    94         /**
    95             @brief Set the owner of the PickupCollection.
    96             @param owner The new Pawn which owns the PickupCollection.
    97         */
    98         inline void setOwner(Pawn* owner)
    99             { this->owner_ = owner; }
     91            /**
     92                @brief Get the owner of the PickupCollection.
     93                @return Returns the pawn which owns the PickupCollection.
     94            */
     95            inline Pawn* getOwner() const
     96                { return this->owner_; }
     97            /**
     98                @brief Set the owner of the PickupCollection.
     99                @param owner The new Pawn which owns the PickupCollection.
     100            */
     101            inline void setOwner(Pawn* owner)
     102                { this->owner_ = owner; }
    100103
    101         inline UsableItem* getCurrentUsable()
    102             { return this->currentUsable_; };
    103         inline void setCurrentUsable(UsableItem* usable)
    104             { this->currentUsable_ = usable; }
     104            inline UsableItem* getCurrentUsable()
     105                { return this->currentUsable_; };
     106            inline void setCurrentUsable(UsableItem* usable)
     107                { this->currentUsable_ = usable; }
    105108
    106         std::deque<EquipmentItem*> getEquipmentItems();   //!< Get a list of equipment-type items.
    107         std::deque<PassiveItem*> getPassiveItems();     //!< Get a list of passive items.
    108         std::deque<UsableItem*> getUsableItems();      //!< Get a list of usable items.
    109     private:
    110         Pawn* owner_;           //!< The owner of the PickupCollection.
    111         UsableItem* currentUsable_;
     109            std::deque<EquipmentItem*> getEquipmentItems();   //!< Get a list of equipment-type items.
     110            std::deque<PassiveItem*> getPassiveItems();     //!< Get a list of passive items.
     111            std::deque<UsableItem*> getUsableItems();      //!< Get a list of usable items.
     112        private:
     113            Pawn* owner_;           //!< The owner of the PickupCollection.
     114            UsableItem* currentUsable_;
    112115
    113         bool bBlockRemovals_;   //!< Whether to block direct removals through remove().
     116            bool bBlockRemovals_;   //!< Whether to block direct removals through remove().
    114117
    115         std::multimap<ModifierType::Value, float> additiveModifiers_;        //!< Contains additive modifiers (indexed by ModifierType).
    116         std::multimap<ModifierType::Value, float> multiplicativeModifiers_;  //!< Contains multiplicative modifiers (indexed by ModifierType).
     118            std::multimap<ModifierType::Value, float> additiveModifiers_;        //!< Contains additive modifiers (indexed by ModifierType).
     119            std::multimap<ModifierType::Value, float> multiplicativeModifiers_;  //!< Contains multiplicative modifiers (indexed by ModifierType).
    117120
    118         std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
     121            std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
    119122    };
    120123}
Note: See TracChangeset for help on using the changeset viewer.