Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h @ 10328

Last change on this file since 10328 was 9667, checked in by landauf, 11 years ago

merged core6 back to trunk

  • Property svn:eol-style set to native
File size: 2.6 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 *      Hagen Seifert
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file EnergyDrink.h
31    @brief Definition of the EnergyDrink class.
32*/
33
34#ifndef _EnergyDrink_H__
35#define _EnergyDrink_H__
36
37#include "weapons/WeaponsPrereqs.h"
38
39#include <string>
40#include "tools/Timer.h"
41#include "weaponsystem/WeaponMode.h"
42
43namespace orxonox
44{
45
46    /**
47    @brief
48        Shoots a can.
49    @author
50        Hagen Seifert
51    @ingroup WeaponsWeaponModes
52    */
53    class _WeaponsExport EnergyDrink : public WeaponMode
54    {
55        public:
56            EnergyDrink(Context* context);
57            virtual ~EnergyDrink() {}
58
59            virtual void fire();
60            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
61
62        private:
63            /**
64            @brief Set the material of the EnergyDrink.
65            @param material The name of the material.
66            */
67            void setMaterial(const std::string& material)
68                { this->material_ = material; }
69            /**
70            @brief Get the material of the EnergyDrink.
71            @return Returns the material name.
72            */
73            inline const std::string& getMaterial() const
74                { return this->material_; }
75
76            void setDelay(float delay);
77            /**
78            @brief Get the firing delay.
79            @return Returns the delay in seconds.
80            */
81            float getDelay() const
82                { return this->delay_; }
83
84            void shot();
85            void muzzleflash();
86
87            std::string material_; //!< The material.
88            float speed_; //!< The speed of the EnergyDrink.
89            float delay_; //!< The firing delay.
90            Timer delayTimer_; //!< The timer to delay the firing.
91    };
92}
93
94#endif /* _EnergyDrink_H__ */
Note: See TracBrowser for help on using the repository browser.