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
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • 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.