[Orxonox-commit 1823] r6540 - in code/trunk/src: modules/pickup modules/pickup/items modules/weapons/projectiles orxonox/interfaces orxonox/items orxonox/pickup orxonox/worldentities/pawns

dafrick at orxonox.net dafrick at orxonox.net
Tue Mar 16 21:35:12 CET 2010


Author: dafrick
Date: 2010-03-16 21:35:11 +0100 (Tue, 16 Mar 2010)
New Revision: 6540

Modified:
   code/trunk/src/modules/pickup/DroppedPickup.cc
   code/trunk/src/modules/pickup/DroppedPickup.h
   code/trunk/src/modules/pickup/Pickup.cc
   code/trunk/src/modules/pickup/Pickup.h
   code/trunk/src/modules/pickup/PickupCollection.cc
   code/trunk/src/modules/pickup/PickupCollection.h
   code/trunk/src/modules/pickup/PickupManager.cc
   code/trunk/src/modules/pickup/PickupManager.h
   code/trunk/src/modules/pickup/PickupRepresentation.cc
   code/trunk/src/modules/pickup/PickupRepresentation.h
   code/trunk/src/modules/pickup/PickupSpawner.cc
   code/trunk/src/modules/pickup/PickupSpawner.h
   code/trunk/src/modules/pickup/items/HealthPickup.cc
   code/trunk/src/modules/pickup/items/HealthPickup.h
   code/trunk/src/modules/weapons/projectiles/Projectile.cc
   code/trunk/src/modules/weapons/projectiles/Rocket.cc
   code/trunk/src/orxonox/interfaces/PickupCarrier.h
   code/trunk/src/orxonox/interfaces/Pickupable.cc
   code/trunk/src/orxonox/interfaces/Pickupable.h
   code/trunk/src/orxonox/items/Engine.cc
   code/trunk/src/orxonox/pickup/PickupIdentifier.cc
   code/trunk/src/orxonox/pickup/PickupIdentifier.h
   code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
   code/trunk/src/orxonox/worldentities/pawns/Pawn.h
Log:
Removed some TODO's. Finished up documenting pickup module.


Modified: code/trunk/src/modules/pickup/DroppedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/DroppedPickup.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,7 +27,7 @@
  */
 
 /**
-    @file
+    @file DroppedPickup.cc
     @brief Implementation of the DroppedPickup class.
 */
 
@@ -35,6 +35,7 @@
 
 #include "core/CoreIncludes.h"
 #include "interfaces/Pickupable.h"
+#include "interfaces/PickupCarrier.h"
 #include "graphics/Model.h"
 
 namespace orxonox
@@ -64,12 +65,14 @@
     @param triggerDistance
         The distance at which the PickupSpawner triggers. Default is 10.
     */
-    DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 10, 1)
+    DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 5, 1)
     {   
         RegisterObject(DroppedPickup);
 
-        this->setPosition(position);
+        this->setPosition(carrier->getCarrierPosition());
         this->setActive(false);
+        
+        //TODO: Do more elegantly.
         this->startRespawnTimer();
     }
 

Modified: code/trunk/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/DroppedPickup.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,7 +27,7 @@
  */
 
 /**
-    @file
+    @file DroppedPickup.h
     @brief Definition of the DroppedPickup class.
 */
 
@@ -52,7 +52,7 @@
     {
         public:
             DroppedPickup(BaseObject* creator); //!< Default constructor.
-            DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position, float triggerDistance = 10.0); //!< Constructor.
+            DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0); //!< Constructor.
             virtual ~DroppedPickup(); //!< Destructor.
 
         protected:

Modified: code/trunk/src/modules/pickup/Pickup.cc
===================================================================
--- code/trunk/src/modules/pickup/Pickup.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/Pickup.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
 */
 
+/**
+    @file Pickup.cc
+    @brief Implementation of the Pickup class.
+*/
+
 #include "Pickup.h"
 
 #include "core/CoreIncludes.h"
@@ -41,9 +46,6 @@
     /*static*/ const std::string Pickup::durationTypeOnce_s = "once";
     /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
     
-    //TODO: Should this be here? Does it work without?
-    CreateFactory(Pickup);
-    
     Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
     {
         RegisterObject(Pickup);
@@ -223,9 +225,9 @@
     @return
         Returns true if a spawner was created, false if not.
     */
-    bool Pickup::createSpawner(const Vector3& position)
+    bool Pickup::createSpawner(void)
     {
-        new DroppedPickup(this, this, position);
+        new DroppedPickup(this, this, this->getCarrier());
         return true;
     }
     

Modified: code/trunk/src/modules/pickup/Pickup.h
===================================================================
--- code/trunk/src/modules/pickup/Pickup.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/Pickup.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
 */
 
+/**
+    @file Pickup.h
+    @brief Declaration of the Pickup class.
+*/
+
 #ifndef _Pickup_H__
 #define _Pickup_H__
 
@@ -69,8 +74,10 @@
     class _PickupExport Pickup : public Pickupable, public BaseObject
     {
         
+        protected:
+            Pickup(BaseObject* creator); //!< Constructor.
+        
         public:
-            Pickup(BaseObject* creator); //!< Constructor.
             virtual ~Pickup(); //!< Destructor.
             
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
@@ -123,7 +130,7 @@
         protected:
             void initializeIdentifier(void);
             
-            virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
             
             /**
             @brief Set the activation type of the pickup.

Modified: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupCollection.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -157,7 +157,7 @@
         SUPER(PickupCollection, clone, item);
         
         PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
-        //! Clone allPickupables this PickupCollection consist of.
+        //! Clone all Pickupables this PickupCollection consist of.
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
             Pickupable* newPickup = (*it).get()->clone();
@@ -239,9 +239,9 @@
     @return
         Returns true if a spawner was created, false if not.
     */
-    bool PickupCollection::createSpawner(const Vector3& position)
+    bool PickupCollection::createSpawner(void)
     {
-        new DroppedPickup(this, this, position);
+        new DroppedPickup(this, this, this->getCarrier());
         return true;
     }
     

Modified: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupCollection.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -76,7 +76,7 @@
         protected:
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
             
-            virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
             
             PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
             

Modified: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupManager.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,7 +27,7 @@
 */
 
 /**
-    @file
+    @file PickupManager.cc
     @brief Implementation of the PickupManager class.
 */
 
@@ -49,10 +49,8 @@
     @brief
         Constructor. Registers the PickupManager and creates the default PickupRepresentation.
     */
-    PickupManager::PickupManager()
+    PickupManager::PickupManager() : defaultRepresentation_(NULL)
     {
-        this->defaultRepresentation_ = NULL;
-        this->pickupCarrierStructure_ = NULL;
         RegisterRootObject(PickupManager);
         
         this->defaultRepresentation_ = new PickupRepresentation();
@@ -67,9 +65,6 @@
     {
         if(this->defaultRepresentation_ != NULL)
             this->defaultRepresentation_->destroy();
-        
-        if(this->pickupCarrierStructure_ != NULL)
-            delete this->pickupCarrierStructure_;
     }
     
     /**
@@ -83,7 +78,6 @@
     @return
         Returns true if successful and false if not.
     */
-    //TODO: Make sure that either the PickupRepresentation is destroyed upon destruction of the PickupManager if the representation wasn't created with XMLPort.
     bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
     {
         if(this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered.

Modified: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupManager.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,7 +27,7 @@
 */
 
 /**
-    @file
+    @file PickupManager.h
     @brief Definition of the PickupManager class.
 */
 
@@ -45,12 +45,6 @@
 
 namespace orxonox
 {
-    //TODO: Actually utilize this.
-    struct PickupCarrierNode
-    {
-        Identifier* identifier;
-        std::set<PickupCarrierNode*> children;
-    };
 
     /**
     @brief
@@ -73,17 +67,11 @@
             bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
             PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
             
-            //TODO: Delete or utilitze this.
-            //bool registerCarrier(Identifier* parent, )
-            
         private:
             static PickupManager* singletonPtr_s;
             
             PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
             std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
-            
-            //TODO: Delete or utilize this.
-            PickupCarrierNode* pickupCarrierStructure_;
         
     };
     

Modified: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
 */
 
+/**
+    @file PickupRepresentation.cc
+    @brief Implementation of the PickupRepresentation class.
+*/
+
 #include "PickupRepresentation.h"
 
 #include "core/CoreIncludes.h"
@@ -43,11 +48,8 @@
         Constructor. Registers the object and initializes its member variables.
         This is primarily for use of the PickupManager in creating a default PickupRepresentation.
     */
-    //TODO: Not this as creator!!!
-    PickupRepresentation::PickupRepresentation() : BaseObject(this)
+    PickupRepresentation::PickupRepresentation() : BaseObject(NULL), spawnerRepresentation_(NULL)
     {
-        this->spawnerRepresentation_ = NULL;
-        
         RegisterObject(PickupRepresentation);
         
         this->initialize();
@@ -57,10 +59,8 @@
     @brief
         Default Constructor. Registers the object and initializes its member variables.
     */
-    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator)
+    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), spawnerRepresentation_(NULL)
     {
-        this->spawnerRepresentation_ = NULL;
-        
         RegisterObject(PickupRepresentation);
         
         this->initialize();
@@ -150,7 +150,7 @@
     @return
         Returns a pointer to the StaticEntity.
     */
-    //TODO: Think of more elegant solution.
+    //TODO: Possibility to define default representation through XML.
     StaticEntity* PickupRepresentation::getDefaultSpawnerRepresentation(PickupSpawner* spawner)
     {
         StaticEntity* representation = new StaticEntity(spawner);

Modified: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
 */
 
+/**
+    @file PickupRepresentation.h
+    @brief Definition of the PickupRepresentation class.
+*/
+
 #ifndef _PickupRepresentation_H__
 #define _PickupRepresentation_H__
 

Modified: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,8 +27,8 @@
  */
 
 /**
-    @file
-    @brief Implementation of PickupSpawner.
+    @file PickupSpawner.cc
+    @brief Implementation of the PickupSpawner class.
 */
 
 #include "PickupSpawner.h"
@@ -51,11 +51,11 @@
     @param creator
         Pointer to the object which created this item.
     */
-    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator)
+    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator), pickup_(NULL)
     {
-        this->initialize();
-
         RegisterObject(PickupSpawner);
+        
+        this->initialize();
     }
 
     /**
@@ -72,7 +72,7 @@
     @param maySpawnedItems
         The maximum number of items spawned by this PickupSpawner.
     */
-    PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
+    PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator), pickup_(NULL)
     {
         RegisterObject(PickupSpawner);
         
@@ -102,8 +102,6 @@
     */
     void PickupSpawner::initialize(void)
     {
-        this->pickup_ = NULL;
-        
         this->triggerDistance_ = 20;
         this->respawnTime_ = 0;
         this->maxSpawnedItems_ = INF;
@@ -169,9 +167,11 @@
     @param dt
         Time since last tick.
     */
-    //TODO: Replace this with a real DistanceTrigger? Or better with collisions?
+    //TODO: Replace with collisions.
     void PickupSpawner::tick(float dt)
     {
+        SUPER(PickupSpawner, tick, dt);
+        
         //! If the PickupSpawner is active.
         if (this->isActive())
         {
@@ -214,7 +214,6 @@
         }
         if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0)
         {
-            //TODO: Nicer? Does this even work?
             this->startRespawnTimer();
 
             this->setActive(false);
@@ -277,7 +276,6 @@
     @param pawn
         Pawn which triggered the PickupSpawner.
     */
-    //TODO: Make more generic -> without pawn.
     void PickupSpawner::trigger(Pawn* pawn)
     {
         if (this->isActive()) //!< Checks whether PickupSpawner is active.
@@ -313,7 +311,6 @@
             }
             else
             {
-                //TODO: Really that severe?
                 if(target == NULL)
                     COUT(1) << "PickupSpawner: Pickupable has no target." << std::endl;
                 

Modified: code/trunk/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/PickupSpawner.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,8 +27,8 @@
  */
 
 /**
-    @file
-    @brief Definition of PickupSpawner.
+    @file PickupSpawner.h
+    @brief Definition of the PickupSpawner class.
 */
 
 #ifndef _PickupSpawner_H__

Modified: code/trunk/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/items/HealthPickup.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file HealthPickup.cc
+    @brief Implementation of the HealthPickup class.
+*/
+
 #include "HealthPickup.h"
 
 #include "core/CoreIncludes.h"
@@ -93,7 +98,6 @@
         std::string val1 = stream.str();
         this->pickupIdentifier_->addParameter(type1, val1);
         
-        //TODO: Does this work, is val valid outside the function scope?
         std::string val2 = this->getHealthType();
         std::string type2 = "healthType";
         this->pickupIdentifier_->addParameter(type2, val2);
@@ -132,6 +136,8 @@
     */
     void HealthPickup::tick(float dt)
     {
+        SUPER(HealthPickup, tick, dt);
+        
         if(this->isContinuous() && this->isUsed())
         {
             Pawn* pawn = this->carrierToPawnHelper();

Modified: code/trunk/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/pickup/items/HealthPickup.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file HealthPickup.h
+    @brief Declaration of the HealthPickup class.
+*/
+
 #ifndef _HealthPickup_H__
 #define _HealthPickup_H__
 

Modified: code/trunk/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Projectile.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/weapons/projectiles/Projectile.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -122,14 +122,9 @@
                 }
             }
 
-            float dmg = this->damage_;
-            //TODO: Remove.
-//             if (this->owner_)
-//                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
-
             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
             if (victim)
-                victim->hit(this->owner_, contactPoint, dmg);
+                victim->hit(this->owner_, contactPoint, this->damage_);
         }
         return false;
     }

Modified: code/trunk/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -199,14 +199,9 @@
                 }
             }
 
-            float dmg = this->damage_;
-            //TODO: This souldn't be necessary here.
-            //if (this->owner_)
-            //    dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
-
             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
             if (victim)
-                victim->hit(this->owner_, contactPoint, dmg);
+                victim->hit(this->owner_, contactPoint, this->damage_);
 //             this->destroy();
         }
         return false;

Modified: code/trunk/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupCarrier.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/interfaces/PickupCarrier.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -27,7 +27,7 @@
  */
 
 /**
-    @file
+    @file PickupCarrier.h
     @brief Definition of the PickupCarrier class.
 */
 
@@ -47,6 +47,7 @@
 namespace orxonox
 {
 
+    //! Pre-declarations.
     class Pickup;
     class HealthPickup;
     class MetaPickup;
@@ -59,8 +60,8 @@
     */
     class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass
     {
-        friend class Pickupable; //!< The Pickupable has full acces to its PickupCarrier.
-        //TODO: Ugly workaround.
+         //! So that the different Pickupables have full access to their PickupCarrier.
+        friend class Pickupable;
         friend class Pickup;
         friend class HealthPickup;
         friend class MetaPickup;
@@ -107,7 +108,6 @@
             @param pickup A pointer to the Pickupable.
             @return Returns true if the PickupCarrier or one of its children is a target, false if not.
             */
-            //TODO: Use?
             bool isTarget(const Pickupable* pickup)
                 {
                     if(pickup->isTarget(this)) //!< If the PickupCarrier itself is a target.
@@ -153,14 +153,21 @@
                     
                     return NULL;
                 }
+                
+            /**
+            @brief Get the (absolute) position of the PickupCarrier.
+                   This method needs to be implemented by any direct derivative class of PickupCarrier.
+            @return Returns the position as a Vector3.
+            */
+            virtual const Vector3& getCarrierPosition(void) = 0;
             
         protected:        
             /**
             @brief Get all direct children of this PickupSpawner.
                    This method needs to be implemented by any direct derivative class of PickupCarrier.
+                   The returned list will be deleted by the methods calling this function.
             @return Returns a pointer to a list of all direct children. 
             */
-            //TODO: Good return type? Maybe not const and destroyed in isTarget...
             virtual std::list<PickupCarrier*>* getCarrierChildren(void) = 0;
             /**
             @brief Get the parent of this PickupSpawner
@@ -168,12 +175,6 @@
             @return Returns a pointer to the parent.
             */
             virtual PickupCarrier* getCarrierParent(void) = 0;
-            /**
-            @brief Get the (absolute) position of the PickupCarrier.
-                   This method needs to be implemented by any direct derivative class of PickupCarrier.
-            @return Returns the position as a Vector3.
-            */
-            virtual const Vector3& getCarrierPosition(void) = 0;
                             
             /**
             @brief Get all Pickupables this PickupCarrier has.

Modified: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -45,11 +45,8 @@
     @brief
         Constructor. Registers the objects and initializes its member variables.
     */
-    Pickupable::Pickupable()
-    {
-        this->used_ = false;
-        this->pickedUp_ = false;
-        
+    Pickupable::Pickupable() : used_(false), pickedUp_(false)
+    {        
         RegisterRootObject(Pickupable);
         
         this->carrier_ = NULL;
@@ -230,10 +227,10 @@
         this->setUsed(false);
         this->setPickedUp(false);
         
-        bool created = this->createSpawner(this->getCarrier()->getCarrierPosition());
+        bool created = this->createSpawner();
         
         this->setCarrier(NULL);
-        //TODO: possible problem.
+        
         if(!created)
         {
             this->destroy();
@@ -266,7 +263,6 @@
     @param item
         A reference to a pointer to the OrxonoxClass that is to be duplicated.
     */
-    //TODO: Specify how the implementation must be done in detail.
     void Pickupable::clone(OrxonoxClass*& item)
     {
         SUPER(Pickupable, clone, item);

Modified: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -50,12 +50,12 @@
     @author
         Damian 'Mozork' Frick
     */
-    //TODO: Add stuff like weight/space ?
     class _OrxonoxExport Pickupable : virtual public OrxonoxClass
     {
+        protected:
+            Pickupable(); //!< Default constructor.
         
         public:
-            Pickupable(); //!< Default constructor.
             virtual ~Pickupable(); //!< Default destructor.
             
             /**
@@ -112,7 +112,6 @@
             virtual const PickupIdentifier* getPickupIdentifier(void)
                 { return this->pickupIdentifier_; }
                 
-            //TODO: Make them work as protected.
             bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
             bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
             bool setCarrier(PickupCarrier* carrier); //!< Sets the carrier of the pickup.
@@ -130,9 +129,8 @@
             @param position The position at which the PickupSpawner should be placed.
             @return Returns true if a spawner was created, false if not.
             */
-            virtual bool createSpawner(const Vector3& position) = 0;
+            virtual bool createSpawner(void) = 0;
             
-            //TODO: Move to private and create get method in protected.
             PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
             
         private:

Modified: code/trunk/src/orxonox/items/Engine.cc
===================================================================
--- code/trunk/src/orxonox/items/Engine.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/items/Engine.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -34,8 +34,6 @@
 #include "core/XMLPort.h"
 #include "Scene.h"
 #include "worldentities/pawns/SpaceShip.h"
-//TODO: Remove.
-//#include "pickup/ModifierType.h"
 #include "tools/Shader.h"
 
 namespace orxonox
@@ -193,7 +191,6 @@
                 acceleration.y = direction.y * this->accelerationUpDown_ * clamp((this->maxSpeedUpDown_ - velocity.y) / this->maxSpeedUpDown_, 0.0f, 1.0f);
         }
 
-        //TODO: Correct?
         this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration);
 
         if (!this->ship_->getPermanentBoost())

Modified: code/trunk/src/orxonox/pickup/PickupIdentifier.cc
===================================================================
--- code/trunk/src/orxonox/pickup/PickupIdentifier.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/pickup/PickupIdentifier.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file PickupIdentifier.cc
+    @brief Implementation of the PickupIdentifier class.
+*/
+
 #include "PickupIdentifier.h"
 
 #include "core/CoreIncludes.h"

Modified: code/trunk/src/orxonox/pickup/PickupIdentifier.h
===================================================================
--- code/trunk/src/orxonox/pickup/PickupIdentifier.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/pickup/PickupIdentifier.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file PickupIdentifier.h
+    @brief Definition of the PickupIdentifier class.
+*/
+
 #ifndef _PickupIdentifier_H__
 #define _PickupIdentifier_H__
 

Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2010-03-16 20:35:11 UTC (rev 6540)
@@ -70,9 +70,6 @@
 
         this->aimPosition_ = Vector3::ZERO;
 
-        //TODO: Remove.
-        //this->getPickups().setOwner(this);
-
         if (GameMode::isMaster())
         {
             this->weaponSystem_ = new WeaponSystem(this);
@@ -296,13 +293,6 @@
             this->spawneffect();
     }
 
-//TODO: Remove.
-//     void Pawn::dropItems()
-//     {
-//         this->getPickups().clear();
-//     }
-
-
     /* WeaponSystem:
     *   functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
     *   with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.

Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	2010-03-16 17:23:06 UTC (rev 6539)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	2010-03-16 20:35:11 UTC (rev 6540)
@@ -108,19 +108,15 @@
             inline unsigned int getExplosionChunks() const
                 { return this->numexplosionchunks_; }
 
-//TODO: Remove.
-//             virtual void dropItems();
-//             inline PickupCollection& getPickups()
-//                 { return this->pickups_; }
-//             virtual void useItem()
-//                 { this->pickups_.useItem(); }
-
             virtual void startLocalHumanControl();
 
             void setAimPosition( Vector3 position )
                 { this->aimPosition_ = position; }
             Vector3 getAimPosition()
                 { return this->aimPosition_; }
+                
+            virtual const Vector3& getCarrierPosition(void)
+                { return this->getWorldPosition(); };
 
         protected:
             virtual void setPlayer(PlayerInfo* player);
@@ -135,14 +131,10 @@
 
             bool bAlive_;
 
-            //TODO: Remove.
-            //PickupCollection pickups_;
             virtual std::list<PickupCarrier*>* getCarrierChildren(void)
                 { return new std::list<PickupCarrier*>(); }
             virtual PickupCarrier* getCarrierParent(void)
                 { return NULL; }
-            virtual const Vector3& getCarrierPosition(void)
-                { return this->getWorldPosition(); };
 
             float health_;
             float maxHealth_;




More information about the Orxonox-commit mailing list