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
Files:
8 added
12 edited
4 moved

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2/src/libraries/core/Super.h

    r5929 r6405  
    267267    #define SUPER_changedGametype(classname, functionname, ...) \
    268268        SUPER_NOARGS(classname, functionname)
     269       
     270    #define SUPER_changedUsed(classname, functionname, ...) \
     271        SUPER_NOARGS(classname, functionname)
    269272    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
    270273
     
    515518
    516519        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedGametype, false)
     520            ()
     521        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     522       
     523        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedUsed, false)
    517524            ()
    518525        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
     
    570577    SUPER_INTRUSIVE_DECLARATION(changedName);
    571578    SUPER_INTRUSIVE_DECLARATION(changedGametype);
     579    SUPER_INTRUSIVE_DECLARATION(changedUsed);
    572580    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
    573581
  • code/branches/pickup2/src/modules/CMakeLists.txt

    r5929 r6405  
    2929ADD_SUBDIRECTORY(objects)
    3030ADD_SUBDIRECTORY(overlays)
     31ADD_SUBDIRECTORY(pickup)
    3132ADD_SUBDIRECTORY(pong)
    3233ADD_SUBDIRECTORY(questsystem)
  • code/branches/pickup2/src/modules/pickup/PickupSpawner.cc

    r5953 r6405  
    2323 *      Daniel 'Huty' Haggenmueller
    2424 *   Co-authors:
    25  *      ...
     25 *      Damian 'Mozork' Frick
    2626 *
    2727 */
     
    3434#include "PickupSpawner.h"
    3535
    36 #include "BaseItem.h"
    37 
    3836#include "core/CoreIncludes.h"
    39 #include "core/GUIManager.h"     // HACK; see below
     37//#include "core/GUIManager.h"     // HACK; see below
    4038#include "core/Template.h"
    4139#include "core/XMLPort.h"
    4240#include "worldentities/pawns/Pawn.h"
    43 #include "PickupInventory.h"    // HACK; Only for hack, remove later
     41//#include "PickupInventory.h"    // HACK; Only for hack, remove later
    4442
    4543
     
    4745{
    4846
    49     const float PickupSpawner::bounceSpeed_s = 6.0f;
    50     const float PickupSpawner::rotationSpeed_s = 1.0f;
    51     const float PickupSpawner::bounceDistance_s = 4.0f;
     47//     const float PickupSpawner::bounceSpeed_s = 6.0f;
     48//     const float PickupSpawner::rotationSpeed_s = 1.0f;
     49//     const float PickupSpawner::bounceDistance_s = 4.0f;
    5250
    5351    CreateFactory(PickupSpawner);
     
    6462    }
    6563
    66     PickupSpawner::PickupSpawner(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
     64    PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
    6765    {
    6866        this->initialize();
    6967 
    70         //TODO: Does this actually work?
    71         this->itemTemplateName_ = item->getIdentifier()->getName();
    72         this->itemTemplate_ = Template::getTemplate(this->itemTemplateName_);
     68        this->pickup_ = pickup;
    7369
    7470        this->triggerDistance_ = triggerDistance;
     
    8177        RegisterObject(PickupSpawner);
    8278
    83         this->itemTemplate_ = NULL;
     79        this->pickup_ = NULL;
     80       
    8481        this->triggerDistance_ = 20;
    85         this->respawnTime_ = 0.0f;
    86         this->tickSum_ = 0.0f;
     82        this->respawnTime_ = 0;
     83        this->tickSum_ = 0;
    8784        this->maxSpawnedItems_ = INF;
    8885        this->spawnsRemaining_ = INF;
     
    110107        SUPER(PickupSpawner, XMLPort, xmlelement, mode);
    111108
    112         XMLPortParam(PickupSpawner, "item", setItemTemplateName, getItemTemplateName, xmlelement, mode);
     109        XMLPortObject(PickupSpawner, Pickupable, "pickup", addPickupable, getPickupable, xmlelement, mode);
     110       
    113111        XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
    114112        XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
     
    119117        // Load the GUI image as soon as the PickupSpawner gets loaded
    120118        //  = less delays while running
    121         BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
    122         BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
    123         if (asItem)
    124         {
    125             asItem->addTemplate(this->itemTemplate_);
    126             PickupInventory::getImageForItem(asItem);
    127             newObject->destroy();
    128         }
     119//         BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
     120//         BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
     121//         if (asItem)
     122//         {
     123//             asItem->addTemplate(this->itemTemplate_);
     124//             PickupInventory::getImageForItem(asItem);
     125//             newObject->destroy();
     126//         }
    129127
    130128        //  & load the GUI itself too, along with some empty windows
    131129        //   = even less delays
    132         GUIManager::getInstance().showGUI("PickupInventory");
    133         GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
    134         PickupInventory::getSingleton();
     130//         GUIManager::getInstance().showGUI("PickupInventory");
     131//         GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
     132//         PickupInventory::getSingleton();
     133    }
     134   
     135    void PickupSpawner::addPickupable(Pickupable* pickup)
     136    {
     137        if(this->pickup_ != NULL)
     138        {
     139            COUT(1) << "addPickupable called, with this->pickup_ already set." << std::endl;
     140            return;
     141        }
     142        if(pickup == NULL)
     143        {
     144            COUT(1) << "Argument of addPickupable is NULL." << std::endl;
     145            return;
     146        }
     147       
     148        this->pickup_ = pickup;
     149    }
     150   
     151    Pickupable* PickupSpawner::getPickupable(void)
     152    {
     153        return this->pickup_;
    135154    }
    136155
     
    139158        Invoked when the activity has changed. Sets visibility of attached objects.
    140159    */
    141     void PickupSpawner::changedActivity()
    142     {
    143         SUPER(PickupSpawner, changedActivity);
    144 
    145         for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
    146             (*it)->setVisible(this->isActive());
    147     }
    148 
    149     /**
    150     @brief
    151         Set the template name of the item to spawn, also loads the template.
    152     @param name
    153         Name of the new template.
    154     */
    155     void PickupSpawner::setItemTemplateName(const std::string& name)
    156     {
    157         this->itemTemplateName_ = name;
    158         this->itemTemplate_ = Template::getTemplate(name);
    159     }
     160//     void PickupSpawner::changedActivity()
     161//     {
     162//         SUPER(PickupSpawner, changedActivity);
     163//
     164//         for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     165//             (*it)->setVisible(this->isActive());
     166//     }
    160167
    161168    void PickupSpawner::setMaxSpawnedItems(int items)
     
    171178        Time since last tick.
    172179    */
    173     //TODO: Replace this with a real DistanceTrigger.
     180    //TODO: Replace this with a real DistanceTrigger?
    174181    void PickupSpawner::tick(float dt)
    175182    {
     183        //! If the PickupSpawner is active.
    176184        if (this->isActive())
    177185        {
    178             //! Triggers as soon as a Pawn is in the specified distance.
     186            //! Iterate trough all Pawns.
    179187            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    180188            {
    181189                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
    182                 if (distance.length() < this->triggerDistance_)
     190                //! If a Pawn, that fits the target-range of the item spawned by this Pickup, is in trigger-distance.
     191                if (distance.length() < this->triggerDistance_ && this->pickup_->isTarget(*it))
     192                {
    183193                    this->trigger(*it);
     194                }
    184195            }
    185196
    186197            //! Animation.
    187             this->yaw(Radian(rotationSpeed_s*dt));
    188             this->tickSum_ += bounceSpeed_s*dt;
    189             this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0));
    190             if (this->tickSum_ > 2*Ogre::Math::PI)
    191                 this->tickSum_ -= 2*Ogre::Math::PI;
     198//             this->yaw(Radian(rotationSpeed_s*dt));
     199//             this->tickSum_ += bounceSpeed_s*dt;
     200//             this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0));
     201//             if (this->tickSum_ > 2*Ogre::Math::PI)
     202//                 this->tickSum_ -= 2*Ogre::Math::PI;
    192203        }
    193204    }
     
    205216    void PickupSpawner::trigger(Pawn* pawn)
    206217    {
    207         if (this->isActive() && this->itemTemplate_ && this->itemTemplate_->getBaseclassIdentifier()) //!< Checks whether PickupItem is active, amongst other things.
    208         {
    209             BaseItem* item = this->getItem();
    210             if (item != NULL) //!< If the conversion was successful.
     218        //TODO: If private, isActive doesn't need to be tested anymore.
     219        if (this->isActive()) //!< Checks whether PickupItem is active.
     220        {
     221            Pickupable* pickup = this->getPickup();
     222            if (pickup != NULL) //!< If everything went ok, and pickup is not NULL.
    211223            {
    212                 item->setPickupIdentifier(this->itemTemplateName_); //TODO: Needed?
    213                 item->addTemplate(this->itemTemplate_); //TODO: Does what?
    214 
    215                 if(item->pickedUp(pawn))
    216                 {
    217                     COUT(3) << this->itemTemplateName_ << " got picked up." << std::endl;
    218 
    219 
    220                     if(this->spawnsRemaining_ != INF)
    221                     {
    222                         this->spawnsRemaining_--;
    223                     }
    224 
    225                     if (this->spawnsRemaining_ != 0 && this->respawnTime_ > 0.0f)
    226                     {
    227                         this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
    228 
    229                         this->setActive(false);
    230                         this->fireEvent();
    231                     }
     224                PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
     225                if(carrier == NULL)
     226                {
     227                    COUT(1) << "This is bad. Pawn isn't PickupCarrier." << std::endl;
     228                    return;
     229                }
     230               
     231                if(pickup->pickup(carrier))
     232                {
     233                    COUT(3) << "Pickup got picked up." << std::endl;
     234
     235                    this->decrementSpawnsRemaining();
    232236                }
    233237                else
    234238                {
    235                     item->destroy();
     239                    pickup->destroy();
    236240                }
    237241            }
    238242        }
    239 
    240         if(this->spawnsRemaining_ == 0)
     243    }
     244   
     245    void PickupSpawner::decrementSpawnsRemaining(void)
     246    {
     247        if(this->spawnsRemaining_ != INF)
     248        {
     249            this->spawnsRemaining_--;
     250        }
     251        if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0)
     252        {
     253            //TODO: Nicer?
     254            this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
     255
     256            this->setActive(false);
     257            this->fireEvent();
     258        }
     259        else
    241260        {
    242261            COUT(3) << "PickupSpawner empty, selfdistruct initialized." << std::endl;
    243262            this->setActive(false);
    244             this->destroy();
    245         }
    246     }
    247 
    248     /**
    249     @brief
    250         Creates a BaseItem of the type specified by the PickupSpawner.
     263            this->destroy(); //TODO: Implement destroy().
     264        }
     265    }
     266
     267    /**
     268    @brief
     269        Creates a new Pickupable.
    251270    @return
    252         The BaseItem created.
     271        The Pickupable created.
    253272    */   
    254     BaseItem* PickupSpawner::getItem(void)
    255     {
    256         BaseObject* newItem = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this); //!< Creates new object of specified item type.
    257         return orxonox_cast<BaseItem*>(newItem);
     273    Pickupable* PickupSpawner::getPickup(void)
     274    {
     275        if(this->spawnsRemaining_ == 0)
     276        {
     277            COUT(1) << "Massive Error: PickupSpawner still alive until having spawned last item." << std::endl;
     278            return NULL;
     279        }
     280       
     281        Pickupable* pickup = this->pickup_->clone();
     282        return pickup;
    258283    }
    259284
  • code/branches/pickup2/src/modules/pickup/PickupSpawner.h

    r5953 r6405  
    3535#define _PickupSpawner_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "pickup/PickupPrereqs.h"
    3838
    3939#include <string>
     
    4141#include "tools/interfaces/Tickable.h"
    4242#include "worldentities/StaticEntity.h"
     43#include "interfaces/Pickupable.h"
    4344
    4445namespace orxonox
     
    5152    {
    5253        public:
    53             //TODO: Add limit of items spawned here. Also possibility to spawn collections?
     54            //TODO: Add limit of items spawned here.
    5455            PickupSpawner(BaseObject* creator);
    55             PickupSpawner(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems);
     56            PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems);
    5657            virtual ~PickupSpawner();
    5758
     
    5960            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
    6061            virtual void tick(float dt);
    61 
    62             void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
    63             void respawnTimerCallback();                                    //!< Method called when the timer runs out.
    64 
    65             /**
    66             @brief Get the template name for the item to spawn.
    67             @return Returns the name of the template of the item to spawn.
    68             */
    69             inline const std::string& getItemTemplateName() const
    70                 { return this->itemTemplateName_; }
    71             void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
    72 
    73             /**
    74                 @brief Get the template for the item to spawn.
    75                 @return Returns the template of the item to spawn.
    76             */
    77             inline Template* getItemTemplate() const
    78                 { return this->itemTemplate_; }
    7962
    8063            /**
     
    11093
    11194        protected:
    112             virtual BaseItem* getItem(void);
     95            virtual Pickupable* getPickup(void);
     96           
     97            void addPickupable(Pickupable* pickup);
     98            Pickupable* getPickupable(void);
     99           
     100            void decrementSpawnsRemaining(void);
    113101
    114102        private:
    115103            void initialize(void);
     104           
     105            void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
     106            void respawnTimerCallback();                                    //!< Method called when the timer runs out.
    116107
    117             std::string itemTemplateName_;          //!< Template name of the item to spawn.
    118             Template* itemTemplate_;                //!< Template of the item to spawn.
     108           
     109            Pickupable* pickup_;
    119110
    120111            int maxSpawnedItems_;                   //!< Maximum number of items spawned by this PickupSpawner.
  • code/branches/pickup2/src/modules/weapons/projectiles/Projectile.cc

    r5929 r6405  
    123123
    124124            float dmg = this->damage_;
    125             if (this->owner_)
    126                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
     125            //TODO: Remove.
     126//             if (this->owner_)
     127//                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
    127128
    128129            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
  • code/branches/pickup2/src/orxonox/CMakeLists.txt

    r5929 r6405  
    4646ADD_SUBDIRECTORY(items)
    4747ADD_SUBDIRECTORY(overlays)
    48 ADD_SUBDIRECTORY(pickup)
    4948ADD_SUBDIRECTORY(sound)
    5049ADD_SUBDIRECTORY(weaponsystem)
     
    5554  TOLUA_FILES
    5655    LevelManager.h
    57     pickup/BaseItem.h
    58     pickup/PickupInventory.h
    5956  DEFINE_SYMBOL
    6057    "ORXONOX_SHARED_BUILD"
  • code/branches/pickup2/src/orxonox/OrxonoxPrereqs.h

    r5929 r6405  
    117117    class GametypeMessageListener;
    118118    class NotificationListener;
     119    class Pickupable;
     120    class PickupCarrier;
    119121    class PlayerTrigger;
    120122    class RadarListener;
     
    133135    class OrxonoxOverlay;
    134136    class OverlayGroup;
    135 
    136     // pickup
    137     class BaseItem;
    138     class DroppedItem;
    139     class EquipmentItem;
    140     class ModifierPickup;
    141     class PassiveItem;
    142     class PickupCollection;
    143     class PickupInventory;
    144     class PickupSpawner;
    145     class UsableItem;
    146     // pickup, items
    147     class HealthImmediate;
    148     class HealthUsable;
    149     class Jump;
    150137
    151138    //sound
  • code/branches/pickup2/src/orxonox/interfaces/InterfaceCompilation.cc

    r5929 r6405  
    3434
    3535#include "GametypeMessageListener.h"
     36#include "Pickupable.h"
     37#include "PickupCarrier.h"
    3638#include "PlayerTrigger.h"
    3739#include "RadarListener.h"
     
    5153        RegisterRootObject(GametypeMessageListener);
    5254    }
     55   
     56    //----------------------------
     57    // Pickupable
     58    //----------------------------
     59    Pickupable::Pickupable()
     60    {
     61        RegisterRootObject(Pickupable);
    5362
     63        this->used_ = false;
     64        this->owner_ = NULL;
     65    }
     66   
     67    //----------------------------
     68    // PickupCarrier
     69    //----------------------------
     70    PickupCarrier::PickupCarrier()
     71    {
     72        RegisterRootObject(PickupCarrier);
     73    }
     74
     75    //----------------------------
     76    // PlayerTrigger
     77    //----------------------------
     78    PlayerTrigger::PlayerTrigger()
     79    {
     80        RegisterRootObject(PlayerTrigger);
     81
     82        this->player_ = NULL;
     83        this->isForPlayer_ = true;
     84    }
     85   
    5486    //----------------------------
    5587    // RadarListener
     
    83115        RegisterRootObject(NotificationListener);
    84116    }
    85 
    86     //----------------------------
    87     // PlayerTrigger
    88     //----------------------------
    89     PlayerTrigger::PlayerTrigger()
    90     {
    91         RegisterRootObject(PlayerTrigger);
    92 
    93         this->player_ = NULL;
    94         this->isForPlayer_ = true;
    95     }
    96117}
  • code/branches/pickup2/src/orxonox/items/Engine.cc

    r5929 r6405  
    3535#include "Scene.h"
    3636#include "worldentities/pawns/SpaceShip.h"
    37 #include "pickup/ModifierType.h"
     37//TODO: Remove.
     38//#include "pickup/ModifierType.h"
    3839#include "tools/Shader.h"
    3940
     
    193194        }
    194195
    195         this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
     196        //TODO: Remove.
     197        //this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
    196198
    197199        if (!this->ship_->getPermanentBoost())
  • 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).
  • code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.cc

    r5929 r6405  
    7070        this->spawnparticleduration_ = 3.0f;
    7171
    72         this->getPickups().setOwner(this);
     72        //TODO: Remove.
     73        //this->getPickups().setOwner(this);
    7374
    7475        if (GameMode::isMaster())
     
    295296    }
    296297
    297     void Pawn::dropItems()
    298     {
    299         this->getPickups().clear();
    300     }
     298//TODO: Remove.
     299//     void Pawn::dropItems()
     300//     {
     301//         this->getPickups().clear();
     302//     }
    301303
    302304
  • code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.h

    r5781 r6405  
    3535#include "interfaces/RadarViewable.h"
    3636#include "worldentities/ControllableEntity.h"
    37 #include "pickup/PickupCollection.h"
     37//TODO: Remove.
     38//#include "pickup/PickupCollection.h"
    3839
    3940namespace orxonox
     
    109110                { return this->numexplosionchunks_; }
    110111
    111             virtual void dropItems();
    112             inline PickupCollection& getPickups()
    113                 { return this->pickups_; }
    114             virtual void useItem()
    115                 { this->pickups_.useItem(); }
     112//TODO: Remove.
     113//             virtual void dropItems();
     114//             inline PickupCollection& getPickups()
     115//                 { return this->pickups_; }
     116//             virtual void useItem()
     117//                 { this->pickups_.useItem(); }
    116118
    117119            virtual void startLocalHumanControl();
     
    128130            bool bAlive_;
    129131
    130             PickupCollection pickups_;
     132            //TODO: Remove.
     133            //PickupCollection pickups_;
    131134
    132135            float health_;
Note: See TracChangeset for help on using the changeset viewer.