Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/objects/pickup/items/Jump.h @ 3074

Last change on this file since 3074 was 3074, checked in by landauf, 15 years ago

removed some warnings and fixed an include error

File size: 3.1 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 Jump.
32*/
33
34#ifndef _Jump_H__
35#define _Jump_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    class Pawn;
47
48    /**
49        @brief Jump-item, enables player to "jump" into a direction.
50    */
51    class _OrxonoxExport Jump : public UsableItem
52    {
53    public:
54        Jump(BaseObject* creator);      //!< Constructor
55        virtual ~Jump();                //!< Deconstructor
56
57        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
58
59        virtual int getMaxCarryAmount() const
60            { return INT_MAX; }
61
62        virtual void used(Pawn* pawn);          //!< Called when the item is used.
63
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.
66
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.
94    };
95}
96
97#endif /* _Jump_H__ */
Note: See TracBrowser for help on using the repository browser.