Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/objects/pickup/items/HealthUsable.h @ 3081

Last change on this file since 3081 was 3081, checked in by bknecht, 15 years ago

fixing an include. why do only I have this problem?

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Daniel 'Huty' Haggenmueller
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file
31    @brief Definition of HealthUsable.
32*/
33
34#ifndef _HealthUsable_H__
35#define _HealthUsable_H__
36
37#include <climits>
38
39#include "OrxonoxPrereqs.h"
40
41#include "objects/pickup/UsableItem.h"
42#include "util/Math.h"
43
44namespace orxonox
45{
46    /**
47        @brief Health-item, enables player recover health when used.
48    */
49    class _OrxonoxExport HealthUsable : public UsableItem
50    {
51    public:
52        HealthUsable(BaseObject* creator);      //!< Constructor
53        virtual ~HealthUsable();                //!< Deconstructor
54
55        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
56
57        virtual int getMaxCarryAmount() const
58            { return INT_MAX; }
59
60        virtual void used(Pawn* pawn);          //!< Called when the item is used.
61
62        virtual bool pickedUp(Pawn* pawn);      //!< Called when the item is picked up.
63        virtual bool dropped(Pawn* pawn);       //!< Called when the item is dropped.
64
65        /**
66            @brief Get the amount of jumps available.
67            @return Returns how many times the item can be used.
68        */
69        inline float getRecoveredHealth() const
70            { return this->recoveredHealth_; }
71        /**
72            @brief Set the amount of jumps available.
73            @param num New number of available jumps.
74        */
75        inline void setRecoveredHealth(float recovery)
76            { this->recoveredHealth_ = recovery; }
77    private:
78        float recoveredHealth_;    //!< Amount of jumps still available.
79    };
80}
81
82#endif /* _HealthUsable_H__ */
Note: See TracBrowser for help on using the repository browser.