Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6538


Ignore:
Timestamp:
Mar 16, 2010, 6:15:45 PM (14 years ago)
Author:
dafrick
Message:

Done some (almost final) documenting in pickup module.

Location:
code/trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pickup/PickupCollection.cc

    r6533 r6538  
    2828
    2929/**
    30     @file
     30    @file PickupCollection.cc
    3131    @brief Implementation of PickupCollection.
    3232*/
    3333
    34 #include "PickupCollection.h"
    35 
    3634#include "core/CoreIncludes.h"
    37 #include "core/Template.h"
    3835#include "core/XMLPort.h"
    3936#include "interfaces/PickupCarrier.h"
    4037#include "DroppedPickup.h"
    41 
    4238#include "PickupCollectionIdentifier.h"
     39
     40#include "PickupCollection.h"
    4341
    4442namespace orxonox
     
    6058    /**
    6159    @brief
    62         Destructor.
     60        Destructor. Iterates through all Pickupables this PickupCollection consists of and destroys them if they haven't been already.
    6361    */
    6462    PickupCollection::~PickupCollection()
     
    8583    }
    8684   
     85    /**
     86    @brief
     87        Initializes the PickupIdentifier for this pickup.
     88    */
    8789    void PickupCollection::initializeIdentifier(void)
    8890    {
     
    9395    }
    9496   
     97    /**
     98    @brief
     99        Is called when the pickup has transited from used to unused or the other way around.
     100        Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedUsed); to their changdeUsed method.
     101    */
     102    void PickupCollection::changedUsed(void)
     103    {
     104        SUPER(PickupCollection, changedUsed);
     105       
     106        //! Change used for all Pickupables this PickupCollection consists of.
     107        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     108        {
     109            (*it).get()->setUsed(this->isUsed());
     110        }
     111    }
     112   
     113    /**
     114    @brief
     115        Is called when the pickup has changed its PickupCarrier.
     116        Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedCarrier); to their changedCarrier method.
     117    */
     118    void PickupCollection::changedCarrier(void)
     119    {
     120        SUPER(PickupCollection, changedCarrier);
     121       
     122        //! Change the PickupCarrier for all Pickupables this PickupCollection consists of.
     123        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     124        {
     125            (*it).get()->setCarrier(this->getCarrier());
     126        }
     127    }
     128   
     129    /**
     130    @brief
     131        Is called when the pickup has transited from picked up to dropped or the other way around.
     132        Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedPickedUp); to their changedPickedUp method.
     133    */
     134    void PickupCollection::changedPickedUp()
     135    {
     136        SUPER(PickupCollection, changedPickedUp);
     137       
     138        //! Change the pickedUp status for all Pickupables this PickupCollection consists of.
     139        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     140        {
     141            (*it).get()->setPickedUp(this->isPickedUp());
     142        }
     143    }
     144   
     145    /**
     146    @brief
     147        Creates a duplicate of the input OrxonoxClass.
     148        This method needs to be implemented by any Class inheriting from Pickupable.
     149    @param item
     150        A reference to a pointer to the OrxonoxClass that is to be duplicated.
     151    */
     152    void PickupCollection::clone(OrxonoxClass*& item)
     153    {
     154        if(item == NULL)
     155            item = new PickupCollection(this);
     156       
     157        SUPER(PickupCollection, clone, item);
     158       
     159        PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
     160        //! Clone allPickupables this PickupCollection consist of.
     161        for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     162        {
     163            Pickupable* newPickup = (*it).get()->clone();
     164            pickup->addPickupable(newPickup);
     165        }
     166
     167        pickup->initializeIdentifier();
     168    }
     169   
     170    /**
     171    @brief
     172        Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
     173    @param identifier
     174        A pointer to the PickupIdentifier of the PickupCarrier we want to know of, whether it is a target of this PickupCollection.
     175    @return
     176        Returns true if the PickupCarrier identified by the input PickupIdentififer it is a target of this PickupCollection, false if not.
     177    */
     178    bool PickupCollection::isTarget(Identifier* identifier) const
     179    {
     180        for(std::vector<WeakPtr<Pickupable> >::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
     181        {
     182            if(!(*it).get()->isTarget(identifier))
     183                return false;
     184        }
     185       
     186        return true;
     187    }
     188   
     189    /**
     190    @brief
     191        Get the PickupIdentifier of this PickupCollection.
     192        This is in fact the PickupCollectionIdentifier.
     193    @return
     194        Returns a pointer to the PickupIdentifier of this PickupCollection.
     195    */
     196    const PickupIdentifier* PickupCollection::getPickupIdentifier(void)
     197    {
     198        return this->pickupCollectionIdentifier_;
     199    }
     200   
     201    /**
     202    @brief
     203        Add the input Pickupable to list of Pickupables combined by this PickupCollection.
     204    @param pickup
     205        The Pickupable to be added.
     206    @return
     207        Returns true if successful,
     208    */
     209    bool PickupCollection::addPickupable(Pickupable* pickup)
     210    {
     211        if(pickup == NULL)
     212            return false;
     213       
     214        WeakPtr<Pickupable> ptr = pickup; //!< Create a weak pointer to be able to test in the constructor if the Pointer is still valid.
     215        this->pickups_.push_back(ptr);
     216        return true;
     217    }
     218   
     219    /**
     220    @brief
     221        Get the Pickupable at the given index.
     222    @param index
     223        The index the Pickupable is fetched from.
     224    @return
     225        Returns a pointer to the Pickupable at the index given by index.
     226    */
     227    const Pickupable* PickupCollection::getPickupable(unsigned int index)
     228    {
     229        return this->pickups_[index].get();
     230    }
     231       
    95232    /**
    96233    @brief
     
    109246    }
    110247   
    111     /**
    112     @brief
    113         Add the input Pickupable to list of Pickupables combined by this PickupCollection.
    114     @param pickup
    115         The Pickupable to be added.
    116     @return
    117         Returns true if successful,
    118     */
    119     bool PickupCollection::addPickupable(Pickupable* pickup)
    120     {
    121         if(pickup == NULL)
    122             return false;
    123        
    124         WeakPtr<Pickupable> ptr = pickup;
    125         this->pickups_.push_back(ptr);
    126         return true;
    127     }
    128    
    129     /**
    130     @brief
    131         Get the Pickupable at the given index.
    132     @param index
    133         The index the Pickupable is fetched from.
    134     @return
    135         Returns a pointer to the Pickupable at the index given by index.
    136     */
    137     const Pickupable* PickupCollection::getPickupable(unsigned int index)
    138     {
    139         return this->pickups_[index].get(); //TODO. Does this work?
    140     }
    141    
    142     void PickupCollection::changedUsed(void)
    143     {
    144         SUPER(PickupCollection, changedUsed);
    145        
    146         //! Change used for all Pickupables this PickupCollection consists of.
    147         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    148         {
    149             (*it).get()->setUsed(this->isUsed());
    150         }
    151     }
    152    
    153     void PickupCollection::changedCarrier(void)
    154     {
    155         SUPER(PickupCollection, changedCarrier);
    156        
    157         //! Change used for all Pickupables this PickupCollection consists of.
    158         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    159         {
    160             (*it).get()->setCarrier(this->getCarrier());
    161         }
    162     }
    163    
    164     void PickupCollection::changedPickedUp()
    165     {
    166         SUPER(PickupCollection, changedPickedUp);
    167        
    168         //! Change the carrier for all Pickupables this PickupCollection consists of.
    169         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    170         {
    171             (*it).get()->setPickedUp(this->isPickedUp());
    172         }
    173     }
    174    
    175     void PickupCollection::clone(OrxonoxClass*& item)
    176     {
    177         if(item == NULL)
    178             item = new PickupCollection(this);
    179        
    180         SUPER(PickupCollection, clone, item);
    181        
    182         PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
    183         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    184         {
    185             Pickupable* newPickup = (*it).get()->clone();
    186             pickup->addPickupable(newPickup);
    187         }
    188 
    189         pickup->initializeIdentifier();
    190     }
    191    
    192     bool PickupCollection::isTarget(Identifier* identifier) const
    193     {
    194         for(std::vector<WeakPtr<Pickupable> >::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    195         {
    196             if(!(*it).get()->isTarget(identifier))
    197                 return false;
    198         }
    199        
    200         return true;
    201     }
    202    
    203     const PickupIdentifier* PickupCollection::getPickupIdentifier(void)
    204     {
    205         return this->pickupCollectionIdentifier_;
    206     }
    207    
    208248}
  • code/trunk/src/modules/pickup/PickupCollection.h

    r6533 r6538  
    2727 */
    2828
     29/**
     30    @file PickupCollection.h
     31    @brief Declaration of PickupCollection.
     32*/
     33
    2934#ifndef _PickupCollection_H__
    3035#define _PickupCollection_H__
     
    3439#include "interfaces/Pickupable.h"
    3540#include "core/BaseObject.h"
    36 #include "core/XMLPort.h"
    3741
    3842#include <list>
     
    5256        public:
    5357           
    54             PickupCollection(BaseObject* creator);
    55             virtual ~PickupCollection();
     58            PickupCollection(BaseObject* creator); //!< Default Constructor.
     59            virtual ~PickupCollection(); //!< Destructor.
    5660           
    57             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     61            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML.
    5862
    59             virtual void changedUsed(void);
    60             virtual void changedCarrier(void);
    61             virtual void changedPickedUp(void);
     63            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
     64            virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier.
     65            virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
    6266           
    63             virtual void clone(OrxonoxClass*& item);
     67            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    6468           
    65             virtual bool isTarget(Identifier* identifier) const;
     69            virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
    6670           
    67             virtual const PickupIdentifier* getPickupIdentifier(void);
     71            virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection.
    6872           
    69             bool addPickupable(Pickupable* pickup);
    70             const Pickupable* getPickupable(unsigned int index);
     73            bool addPickupable(Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
     74            const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index.
    7175           
    7276        protected:
    73             void initializeIdentifier(void);
     77            void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
    7478           
    7579            virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    7680           
    77             PickupCollectionIdentifier* pickupCollectionIdentifier_;
     81            PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
    7882           
    7983        private:
    8084           
    81             std::vector<WeakPtr<Pickupable> > pickups_;
     85            std::vector<WeakPtr<Pickupable> > pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
    8286       
    8387    };
  • code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc

    r6524 r6538  
    2121 *
    2222 *   Author:
    23  *      ...
     23 *      Damian 'Mozork' Frick
    2424 *   Co-authors:
    2525 *      ...
     
    2727*/
    2828
    29 #include "PickupCollectionIdentifier.h"
     29/**
     30    @file PickupCollectionIdentifier.cc
     31    @brief Implementation of PickupCollectionIdentifier.
     32*/
    3033
    3134#include "core/CoreIncludes.h"
     35
     36#include "PickupCollectionIdentifier.h"
    3237
    3338namespace orxonox
    3439{
    3540   
     41    /**
     42    @brief
     43        Constructor. Registers the object.
     44    */
    3645    PickupCollectionIdentifier::PickupCollectionIdentifier(Pickupable* pickup) : PickupIdentifier(pickup)
    3746    {
     
    3948    }
    4049   
     50    /**
     51    @brief
     52        Destructor.
     53    */
    4154    PickupCollectionIdentifier::~PickupCollectionIdentifier()
    4255    {
     
    4457    }
    4558
     59    /**
     60    @brief
     61        Compares a PickupCollectionIdentifier with a PickupIdentifier and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b), where a is a PickupCollectionIdentifier and b is just some PickupIdentifier.
     62    @param identifier
     63        Pointer to the second PickupIdentifier, b.
     64    @return
     65        Returns an integer. 0 if the two compared PickupIdentifiers are the same, <0 if a < b and >0 if a > b.
     66    */
    4667    int PickupCollectionIdentifier::compare(const PickupIdentifier* identifier) const
    4768    {
     69        //! Slight un-niceity to cast the PickupIdentifier to a PickupCollectionIdentifier.
    4870        PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier);
    4971        const PickupCollectionIdentifier* collectionIdentifier = dynamic_cast<PickupCollectionIdentifier*>(temp);
     72       
     73        //! If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
    5074        if(collectionIdentifier == NULL)
    5175        {
     
    5377        }
    5478       
     79        //! If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
    5580        if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
    5681            return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
    5782       
     83        //! Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
    5884        std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin();
    5985        for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++)
     
    6692        }
    6793       
     94        //! Means they are equal.
    6895        return 0;
    6996    }
    7097   
     98    /**
     99    @brief
     100        Add a Pickupable to the PickupCollectionIdentifier.
     101    @param
     102        A pointer to the PickupIdentifier of the Pickupable to be added.
     103    */
    71104    void PickupCollectionIdentifier::addPickup(const PickupIdentifier* identifier)
    72105    {
  • code/trunk/src/modules/pickup/PickupCollectionIdentifier.h

    r6524 r6538  
    2121 *
    2222 *   Author:
    23  *      ...
     23 *      Damian 'Mozork' Frick
    2424 *   Co-authors:
    2525 *      ...
    2626 *
     27*/
     28
     29/**
     30    @file PickupCollectionIdentifier.h
     31    @brief Declaration of PickupCollectionIdentifier.
    2732*/
    2833
     
    3338
    3439#include "pickup/PickupIdentifier.h"
     40
    3541#include <set>
    3642
     
    3844{
    3945
     46    /**
     47    @brief
     48        The PickupCollectionIdentifier is the specialization of the PickupIdentifier for the PickupCollection class.
     49        It identifies PickupCollections based on the different Pickupables they consist of.
     50        Pickupables can be added to the PickupCollectionIdentifier via the addPickup method.
     51    @author
     52        Damian 'Mozork' Frick
     53    */
    4054    class _PickupExport PickupCollectionIdentifier : public PickupIdentifier
    4155    {
    4256       
    4357        public:
    44             PickupCollectionIdentifier(Pickupable* pickup);
    45             ~PickupCollectionIdentifier();
     58            PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor.
     59            ~PickupCollectionIdentifier(); //!< Destructor.
    4660           
    47             virtual int compare(const PickupIdentifier* identifier) const;
     61            virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier.
    4862           
    49             void addPickup(const PickupIdentifier* identifier);
     63            void addPickup(const PickupIdentifier* identifier); //!< Add a Pickupable to the PickupCollectionIdentifier.
    5064           
    5165        private:
    52             std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_;
     66            std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the Pickupables the PickupCollection with this PickupCollectionIdentifier consists of, ordered by the rule set by PickupIdentifierCompare.
    5367           
    5468    };
  • code/trunk/src/modules/pickup/items/MetaPickup.cc

    r6524 r6538  
    2828
    2929/**
    30     @file
     30    @file MetaPickup.cc
    3131    @brief Implementation of the MetaPickup class.
    3232*/
     
    4343    CreateFactory(MetaPickup);
    4444   
     45    //! Setting the static variables to their values.
    4546    /*static*/ const std::string MetaPickup::metaTypeNone_s = "none";
    4647    /*static*/ const std::string MetaPickup::metaTypeUse_s = "use";
     
    4950    /**
    5051    @brief
    51         Constructor.
     52        Constructor. Registers and initializes the object.
    5253    */
    5354    MetaPickup::MetaPickup(BaseObject* creator) : Pickup(creator)
     
    5556        RegisterObject(MetaPickup);
    5657       
     58        this->initialize();
     59    }
     60   
     61    /**
     62    @brief
     63        Destructor.
     64    */
     65    MetaPickup::~MetaPickup()
     66    {
     67       
     68    }
     69   
     70    /**
     71    @brief
     72        Initializes the object.
     73    */
     74    void MetaPickup::initialize(void)
     75    {
    5776        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
     77       
    5878        this->setActivationTypeDirect(pickupActivationType::immediate);
    5979        this->setDurationTypeDirect(pickupDurationType::once);
     
    6181    }
    6282   
    63     MetaPickup::~MetaPickup()
    64     {
    65        
    66     }
    67    
     83    /**
     84    @brief
     85        Helper method to initialize the PickupIdentifier.
     86    */
    6887    void MetaPickup::initializeIdentifier(void)
    6988    {
     
    7392    }
    7493   
     94    /**
     95    @brief
     96        Method for creating a MetaPickup object through XML.
     97    */
    7598    void MetaPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
    7699    {
     
    82105    }
    83106   
     107    /**
     108    @brief
     109        Is called when the pickup has transited from used to unused or the other way around.
     110        Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedUsed); to their changdeUsed method.
     111    */
    84112    void MetaPickup::changedUsed(void)
    85113    {
    86114        SUPER(MetaPickup, changedUsed);
    87115       
     116        //! If the MetaPickup transited to used.
    88117        if(this->isUsed())
    89118        {
     
    92121            {
    93122                std::set<Pickupable*> pickups = carrier->getPickups();
     123                //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending o the meta type.
    94124                for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
    95125                {
     
    114144        }
    115145    }
    116    
     146       
     147    /**
     148    @brief
     149        Creates a duplicate of the input OrxonoxClass.
     150    @param item
     151        A pointer to the Orxonox class.
     152    */
     153    void MetaPickup::clone(OrxonoxClass*& item)
     154    {
     155        if(item == NULL)
     156            item = new MetaPickup(this);
     157       
     158        SUPER(MetaPickup, clone, item);
     159       
     160        MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
     161        pickup->setMetaTypeDirect(this->getMetaTypeDirect());
     162       
     163        pickup->initializeIdentifier();
     164    }
     165   
     166    /**
     167    @brief
     168        Get the meta type of this MetaPickup.
     169    @return
     170        Returns a string with the meta type of the MetaPickup.
     171    */
    117172    const std::string& MetaPickup::getMetaType(void)
    118173    {
     
    130185    }
    131186   
     187    /**
     188    @brief
     189        Set the meta type of this MetaPickup.
     190    @param type
     191        A string with the type to be set.
     192    */
    132193    void MetaPickup::setMetaType(const std::string& type)
    133194    {
     
    146207    }
    147208   
    148     void MetaPickup::clone(OrxonoxClass*& item)
    149     {
    150         if(item == NULL)
    151             item = new MetaPickup(this);
    152        
    153         SUPER(MetaPickup, clone, item);
    154        
    155         MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
    156         pickup->setMetaTypeDirect(this->getMetaTypeDirect());
    157        
    158         pickup->initializeIdentifier();
    159     }
    160    
    161209}
  • code/trunk/src/modules/pickup/items/MetaPickup.h

    r6524 r6538  
    2828
    2929/**
    30     @file
     30    @file MetaPickup.h
    3131    @brief Definition of the MetaPickup class.
    3232*/
     
    6262       
    6363        public:
    64             MetaPickup(BaseObject* creator);
    65             virtual ~MetaPickup();
     64            MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     65            virtual ~MetaPickup(); //!< Destructor.
    6666           
    67             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
     67            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup object through XML.
    6868           
    6969            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    7070            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    7171           
     72            /**
     73            @brief Returns the meta type of the MetaPickup.
     74            @return Returns an enum with the meta type of the MetaPickup.
     75            */
    7276            inline pickupMetaType::Value getMetaTypeDirect(void)
    7377                { return this->metaType_; }
    74             const std::string& getMetaType(void);
     78            const std::string& getMetaType(void); //!< Get the meta type of this MetaPickup.
    7579           
    7680        protected:
     81            void initialize(void); //!< Initializes the object.
    7782            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    7883           
     84            /**
     85            @brief Set the meta type of the MetaPickup.
     86            @param type The meta type as an enum.
     87            */
    7988            inline void setMetaTypeDirect(pickupMetaType::Value type)
    8089                { this->metaType_ =  type; }
    81             void setMetaType(const std::string& type);
     90            void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
    8291           
    8392        private:
    8493            void initialize(void); //!< Initializes the member variables.
    8594           
    86             pickupMetaType::Value metaType_;
     95            pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
     96           
     97            //! Static strings for the meta types.
    8798            static const std::string metaTypeNone_s;
    8899            static const std::string metaTypeUse_s;
  • code/trunk/src/orxonox/interfaces/Pickupable.cc

    r6524 r6538  
    2828
    2929/**
    30     @file
     30    @file Pickupable.cc
    3131    @brief Implementation of the Pickupable class.
    3232*/
     
    9696    /**
    9797    @brief
    98         Get whether the given PickupCarrier is a target of this pickup.
     98        Get whether the given PickupCarrier is a target of this Pickupable.
    9999    @param carrier
    100         The PickupCarrier of which it has to be determinde whether it is a target of this pickup.
     100        The PickupCarrier of which it has to be determinde whether it is a target of this Pickupable.
    101101    @return
    102102        Returns true if the given PickupCarrier is a target.
     
    109109    /**
    110110    @brief
    111         Get whether a given class, represented by the input Identifier, is a target of this pickup.
     111        Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    112112    @param target
    113         The Identifier of which it has to be determinde whether it is a target of this pickup.
     113        The Identifier of which it has to be determinde whether it is a target of this Pickupable.
    114114    @return
    115115        Returns true if the given Identifier is a target.
     
    128128    /**
    129129    @brief
    130         Add a PickupCarrier as target of this pickup.
     130        Add a PickupCarrier as target of this Pickupable.
    131131    @param target
    132132        The PickupCarrier to be added.
     
    141141    /**
    142142    @brief
    143         Add a class, representetd by the input Identifier, as target of this pickup.
     143        Add a class, representetd by the input Identifier, as target of this Pickupable.
    144144    @param target
    145145        The Identifier to be added.
     
    199199    /**
    200200    @brief
    201         Sets the carrier of the pickup.
     201        Sets the carrier of the Pickupable.
    202202    @param carrier
    203203        Sets the input PickupCarrier as the carrier of the pickup.
     
    265265        This method needs to be implemented by any Class inheriting from Pickupable.
    266266    @param item
    267         A pointer to the OrxonoxClass that is to be duplicated.
     267        A reference to a pointer to the OrxonoxClass that is to be duplicated.
    268268    */
    269269    //TODO: Specify how the implementation must be done in detail.
  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r6533 r6538  
    2828
    2929/**
    30     @file
     30    @file Pickupable.h
    3131    @brief Definition of the Pickupable class.
    3232*/
     
    100100           
    101101            bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
    102             virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this pickup.
     102            virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    103103            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
    104104            bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.
     
    123123            @brief Helper method to initialize the PickupIdentifier.
    124124            */
    125             //TODO: Really needed?
    126125            void initializeIdentifier(void) {}
    127126           
Note: See TracChangeset for help on using the changeset viewer.