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/interfaces
Files:
3 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           
Note: See TracChangeset for help on using the changeset viewer.