Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 16, 2010, 9:35:11 PM (15 years ago)
Author:
dafrick
Message:

Removed some TODO's. Finished up documenting pickup module.

Location:
code/trunk/src/orxonox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/interfaces/PickupCarrier.h

    r6533 r6540  
    2828
    2929/**
    30     @file
     30    @file PickupCarrier.h
    3131    @brief Definition of the PickupCarrier class.
    3232*/
     
    4848{
    4949
     50    //! Pre-declarations.
    5051    class Pickup;
    5152    class HealthPickup;
     
    6061    class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass
    6162    {
    62         friend class Pickupable; //!< The Pickupable has full acces to its PickupCarrier.
    63         //TODO: Ugly workaround.
     63         //! So that the different Pickupables have full access to their PickupCarrier.
     64        friend class Pickupable;
    6465        friend class Pickup;
    6566        friend class HealthPickup;
     
    108109            @return Returns true if the PickupCarrier or one of its children is a target, false if not.
    109110            */
    110             //TODO: Use?
    111111            bool isTarget(const Pickupable* pickup)
    112112                {
     
    154154                    return NULL;
    155155                }
     156               
     157            /**
     158            @brief Get the (absolute) position of the PickupCarrier.
     159                   This method needs to be implemented by any direct derivative class of PickupCarrier.
     160            @return Returns the position as a Vector3.
     161            */
     162            virtual const Vector3& getCarrierPosition(void) = 0;
    156163           
    157164        protected:       
     
    159166            @brief Get all direct children of this PickupSpawner.
    160167                   This method needs to be implemented by any direct derivative class of PickupCarrier.
     168                   The returned list will be deleted by the methods calling this function.
    161169            @return Returns a pointer to a list of all direct children.
    162170            */
    163             //TODO: Good return type? Maybe not const and destroyed in isTarget...
    164171            virtual std::list<PickupCarrier*>* getCarrierChildren(void) = 0;
    165172            /**
     
    169176            */
    170177            virtual PickupCarrier* getCarrierParent(void) = 0;
    171             /**
    172             @brief Get the (absolute) position of the PickupCarrier.
    173                    This method needs to be implemented by any direct derivative class of PickupCarrier.
    174             @return Returns the position as a Vector3.
    175             */
    176             virtual const Vector3& getCarrierPosition(void) = 0;
    177178                           
    178179            /**
  • code/trunk/src/orxonox/interfaces/Pickupable.cc

    r6538 r6540  
    4646        Constructor. Registers the objects and initializes its member variables.
    4747    */
    48     Pickupable::Pickupable()
    49     {
    50         this->used_ = false;
    51         this->pickedUp_ = false;
    52        
     48    Pickupable::Pickupable() : used_(false), pickedUp_(false)
     49    {       
    5350        RegisterRootObject(Pickupable);
    5451       
     
    231228        this->setPickedUp(false);
    232229       
    233         bool created = this->createSpawner(this->getCarrier()->getCarrierPosition());
     230        bool created = this->createSpawner();
    234231       
    235232        this->setCarrier(NULL);
    236         //TODO: possible problem.
     233       
    237234        if(!created)
    238235        {
     
    267264        A reference to a pointer to the OrxonoxClass that is to be duplicated.
    268265    */
    269     //TODO: Specify how the implementation must be done in detail.
    270266    void Pickupable::clone(OrxonoxClass*& item)
    271267    {
  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r6539 r6540  
    5151        Damian 'Mozork' Frick
    5252    */
    53     //TODO: Add stuff like weight/space ?
    5453    class _OrxonoxExport Pickupable : virtual public OrxonoxClass
    5554    {
     55        protected:
     56            Pickupable(); //!< Default constructor.
    5657       
    5758        public:
    58             Pickupable(); //!< Default constructor.
    5959            virtual ~Pickupable(); //!< Default destructor.
    6060           
     
    113113                { return this->pickupIdentifier_; }
    114114               
    115             //TODO: Make them work as protected.
    116115            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
    117116            bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
     
    131130            @return Returns true if a spawner was created, false if not.
    132131            */
    133             virtual bool createSpawner(const Vector3& position) = 0;
     132            virtual bool createSpawner(void) = 0;
    134133           
    135             //TODO: Move to private and create get method in protected.
    136134            PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
    137135           
  • code/trunk/src/orxonox/items/Engine.cc

    r6524 r6540  
    3535#include "Scene.h"
    3636#include "worldentities/pawns/SpaceShip.h"
    37 //TODO: Remove.
    38 //#include "pickup/ModifierType.h"
    3937#include "tools/Shader.h"
    4038
     
    194192        }
    195193
    196         //TODO: Correct?
    197194        this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration);
    198195
  • code/trunk/src/orxonox/pickup/PickupIdentifier.cc

    r6524 r6540  
    2626 *
    2727 */
     28
     29/**
     30    @file PickupIdentifier.cc
     31    @brief Implementation of the PickupIdentifier class.
     32*/
    2833
    2934#include "PickupIdentifier.h"
  • code/trunk/src/orxonox/pickup/PickupIdentifier.h

    r6524 r6540  
    2626 *
    2727 */
     28
     29/**
     30    @file PickupIdentifier.h
     31    @brief Definition of the PickupIdentifier class.
     32*/
    2833
    2934#ifndef _PickupIdentifier_H__
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r6524 r6540  
    7171        this->aimPosition_ = Vector3::ZERO;
    7272
    73         //TODO: Remove.
    74         //this->getPickups().setOwner(this);
    75 
    7673        if (GameMode::isMaster())
    7774        {
     
    297294    }
    298295
    299 //TODO: Remove.
    300 //     void Pawn::dropItems()
    301 //     {
    302 //         this->getPickups().clear();
    303 //     }
    304 
    305 
    306296    /* WeaponSystem:
    307297    *   functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r6524 r6540  
    109109                { return this->numexplosionchunks_; }
    110110
    111 //TODO: Remove.
    112 //             virtual void dropItems();
    113 //             inline PickupCollection& getPickups()
    114 //                 { return this->pickups_; }
    115 //             virtual void useItem()
    116 //                 { this->pickups_.useItem(); }
    117 
    118111            virtual void startLocalHumanControl();
    119112
     
    122115            Vector3 getAimPosition()
    123116                { return this->aimPosition_; }
     117               
     118            virtual const Vector3& getCarrierPosition(void)
     119                { return this->getWorldPosition(); };
    124120
    125121        protected:
     
    136132            bool bAlive_;
    137133
    138             //TODO: Remove.
    139             //PickupCollection pickups_;
    140134            virtual std::list<PickupCarrier*>* getCarrierChildren(void)
    141135                { return new std::list<PickupCarrier*>(); }
    142136            virtual PickupCarrier* getCarrierParent(void)
    143137                { return NULL; }
    144             virtual const Vector3& getCarrierPosition(void)
    145                 { return this->getWorldPosition(); };
    146138
    147139            float health_;
Note: See TracChangeset for help on using the changeset viewer.