Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 11:07:09 PM (15 years ago)
Author:
rgrieder
Message:

Merged pickup2 into pickup3.

Location:
code/branches/pickup3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3

  • code/branches/pickup3/src/orxonox/pickup/items/HealthImmediate.cc

    r5929 r6419  
    5959    }
    6060
     61    //TODO: Should be destroyed anyways...
    6162    bool HealthImmediate::pickedUp(Pawn* pawn)
    6263    {
  • code/branches/pickup3/src/orxonox/pickup/items/HealthImmediate.h

    r5781 r6419  
    4545    class _OrxonoxExport HealthImmediate : public PassiveItem
    4646    {
    47     public:
    48         HealthImmediate(BaseObject* creator);
    49         virtual ~HealthImmediate();
     47        //TODO: Comment.
     48        //Does this get destroyed, when the healt is delivered? It seems to me it doesn't.
     49        public:
     50            HealthImmediate(BaseObject* creator);
     51            virtual ~HealthImmediate();
    5052
    51         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5254
    53         virtual bool pickedUp(Pawn* pawn);
     55            virtual bool pickedUp(Pawn* pawn);
    5456
    55         inline float getRecoveredHealth() const
    56             { return this->recoveredHealth_; }
    57         inline void setRecoveredHealth(float recovery)
    58             { this->recoveredHealth_ = recovery; }
     57            inline float getRecoveredHealth() const
     58                { return this->recoveredHealth_; }
     59            inline void setRecoveredHealth(float recovery)
     60                { this->recoveredHealth_ = recovery; }
    5961
    60     private:
    61         float recoveredHealth_;
     62        private:
     63            float recoveredHealth_;
    6264    };
    6365}
  • code/branches/pickup3/src/orxonox/pickup/items/HealthUsable.cc

    r5929 r6419  
    4545
    4646    /**
    47         @brief Constructor
    48         @param creator Object that created this item.
     47    @brief Constructor
     48    @param creator Object that created this item.
    4949    */
    5050    HealthUsable::HealthUsable(BaseObject* creator) : UsableItem(creator)
     
    5454        this->recoveredHealth_ = 0;
    5555    }
     56
    5657    //! Deconstructor
    5758    HealthUsable::~HealthUsable()
    5859    {
    5960    }
     61
    6062    /**
    61         @brief XMLPort for Jump.
    62         @param xmlelement Element of the XML-file.
    63         @param mode XMLPort mode to use.
     63    @brief XMLPort for Jump.
     64    @param xmlelement Element of the XML-file.
     65    @param mode XMLPort mode to use.
    6466    */
    6567    void HealthUsable::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     
    6971        XMLPortParam(HealthUsable, "recoveredHealth", setRecoveredHealth, getRecoveredHealth, xmlelement, mode);
    7072    }
     73
    7174    /**
    72         @brief Called when the item is used, makes the user "jump".
    73         @param pawn Pawn which used te item.
     75    @brief Called when the item is used, makes the user "jump".
     76    @param pawn Pawn which used te item.
    7477    */
     78    //TODO: Jump? Nope! => Comment.
     79    //Should be destroyed anyways.
    7580    void HealthUsable::used(Pawn* pawn)
    7681    {
     
    8590        }
    8691    }
     92
    8793    /**
    88         @brief Called when the item is picked up.
    89         @param pawn Pawn which picked up the item.
     94    @brief Called when the item is picked up.
     95    @param pawn Pawn which picked up the item.
    9096    */
    9197    bool HealthUsable::pickedUp(Pawn* pawn)
     
    9399        return this->addTo(pawn);
    94100    }
     101
    95102    /**
    96         @brief Called when the item is dropped, creates a DroppedItem behind the pawn.
    97         @param pawn Pawn which dropped the item.
     103    @brief Called when the item is dropped, creates a DroppedItem behind the pawn.
     104    @param pawn Pawn which dropped the item.
    98105    */
    99106    bool HealthUsable::dropped(Pawn* pawn)
  • code/branches/pickup3/src/orxonox/pickup/items/Jump.h

    r5781 r6419  
    5050    class _OrxonoxExport Jump : public UsableItem
    5151    {
    52     public:
    53         Jump(BaseObject* creator);      //!< Constructor
    54         virtual ~Jump();                //!< Deconstructor
     52        public:
     53            //TODO: Comment. a.s.o.
     54            Jump(BaseObject* creator);      //!< Constructor
     55            virtual ~Jump();                //!< Deconstructor
    5556
    56         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
     57            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
    5758
    58         virtual int getMaxCarryAmount() const
    59             { return INT_MAX; }
     59            virtual int getMaxCarryAmount() const
     60                { return INT_MAX; }
    6061
    61         virtual void used(Pawn* pawn);          //!< Called when the item is used.
     62            virtual void used(Pawn* pawn);          //!< Called when the item is used.
    6263
    63         virtual bool pickedUp(Pawn* pawn);      //!< Called when the item is picked up.
    64         virtual bool dropped(Pawn* pawn);       //!< Called when the item is dropped.
     64            virtual bool pickedUp(Pawn* pawn);      //!< Called when the item is picked up.
     65            virtual bool dropped(Pawn* pawn);       //!< Called when the item is dropped.
    6566
    66         /**
    67             @brief Get the velocity added when the item is used.
    68             @return Returns the added velocity (relative to the Pawn).
    69         */
    70         inline const Vector3& getVelocity() const
    71             { return this->velocity_; }
    72         /**
    73             @brief Set the velocity added when the item is used.
    74             @param velocity New added velocity (relative to Pawn).
    75         */
    76         inline void setVelocity(const Vector3& velocity)
    77             { this->velocity_ = velocity; }
    78         /**
    79             @brief Get the amount of jumps available.
    80             @return Returns how many times the item can be used.
    81         */
    82         inline int getJumpsAvailable() const
    83             { return this->jumpsAvailable_; }
    84         /**
    85             @brief Set the amount of jumps available.
    86             @param num New number of available jumps.
    87         */
    88         inline void setJumpsAvailable(int num)
    89             { this->jumpsAvailable_ = num; }
    90     private:
    91         Vector3 velocity_;      //!< The velocity added when the item is used.
    92         int jumpsAvailable_;    //!< Amount of jumps still available.
     67            /**
     68                @brief Get the velocity added when the item is used.
     69                @return Returns the added velocity (relative to the Pawn).
     70            */
     71            inline const Vector3& getVelocity() const
     72                { return this->velocity_; }
     73            /**
     74                @brief Set the velocity added when the item is used.
     75                @param velocity New added velocity (relative to Pawn).
     76            */
     77            inline void setVelocity(const Vector3& velocity)
     78                { this->velocity_ = velocity; }
     79            /**
     80                @brief Get the amount of jumps available.
     81                @return Returns how many times the item can be used.
     82            */
     83            inline int getJumpsAvailable() const
     84                { return this->jumpsAvailable_; }
     85            /**
     86                @brief Set the amount of jumps available.
     87                @param num New number of available jumps.
     88            */
     89            inline void setJumpsAvailable(int num)
     90                { this->jumpsAvailable_ = num; }
     91        private:
     92            Vector3 velocity_;      //!< The velocity added when the item is used.
     93            int jumpsAvailable_;    //!< Amount of jumps still available.
    9394    };
    9495}
Note: See TracChangeset for help on using the changeset viewer.