Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2009, 8:27:17 PM (15 years ago)
Author:
dafrick
Message:

Commit changes in pickup before merge.

Location:
code/branches/pickup2/src/orxonox/pickup
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2/src/orxonox/pickup/CMakeLists.txt

    r5781 r6405  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    22  BaseItem.cc
    3   DroppedItem.cc
    43  EquipmentItem.cc
    54  ModifierPickup.cc
     
    76  PickupCollection.cc
    87  PickupInventory.cc
    9   PickupSpawner.cc
    108  UsableItem.cc
    119)
  • code/branches/pickup2/src/orxonox/pickup/PickupCollection.cc

    r5781 r6405  
    5252
    5353    /**
    54         @brief
    55             Add an item to the collection.
    56 
    57             Only adds the item if there's a free slot for it.
    58 
    59         @param item Item to add to the collection.
    60         @return Returns whether the item has been added to the collection.
     54    @brief
     55        Add an item to the collection.
     56
     57        Only adds the item if there's a free slot for it.
     58
     59    @param item
     60        Item to add to the collection.
     61    @return
     62        Returns whether the item has been added to the collection.
    6163    */
    6264    bool PickupCollection::add(BaseItem* item)
  • code/branches/pickup2/src/orxonox/pickup/PickupCollection.h

    r5947 r6405  
    5050    @author Daniel 'Huty' Haggenmueller
    5151    */
    52     class _OrxonoxExport PickupCollection
     52    class _OrxonoxExport PickupCollection : public orxonox::OrxonoxClass
    5353    {
    5454        public:
    55             //TODO: Should probably be derived from OrxonoxClass???
    5655            PickupCollection();
    5756
     
    6564            void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
    6665
    67             //TODO: What's up with that?
     66            //TODO: Hmm... probably should stay...
    6867            void useItem();                                                             //!< Use the first usable item.
    6968            void useItem(UsableItem* item);                                             //!< Use a usable item.
    70 
    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.
    74 
    75             float getAdditiveModifier(ModifierType::Value type);                         //!< Get total additive modifier.
    76             float getMultiplicativeModifier(ModifierType::Value type);                   //!< Get total multiplicative modifier.
    77 
    78             void removeAdditiveModifier(ModifierType::Value type, float value);          //!< Remove an additive modifier.
    79             void removeMultiplicativeModifier(ModifierType::Value type, float value);    //!< Remove a multiplicative modifier.
    80 
    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.
    83 
    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_; }
    9069
    9170            /**
     
    11089            std::deque<PassiveItem*> getPassiveItems();     //!< Get a list of passive items.
    11190            std::deque<UsableItem*> getUsableItems();      //!< Get a list of usable items.
     91
    11292        private:
    113             Pawn* owner_;           //!< The owner of the PickupCollection.
     93            Pawn* owner_; //!< The owner of the PickupCollection.
    11494            UsableItem* currentUsable_;
    115 
    116             bool bBlockRemovals_;   //!< Whether to block direct removals through remove().
    117 
    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).
     95            int slots_;
    12096
    12197            std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
Note: See TracChangeset for help on using the changeset viewer.