Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/core3/src/orxonox/objects/Projectile.h @ 1684

Last change on this file since 1684 was 1684, checked in by landauf, 16 years ago
  • packed all super-function-related code into a bunch of macros and commented the code.
  • added tick, XMLPort, changedActivity and changedVisibility as super-functions
  • Property svn:eol-style set to native
File size: 3.0 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 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _Projectile_H__
30#define _Projectile_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include "core/Super.h"
35#include "WorldEntity.h"
36#include "tools/Timer.h"
37
38namespace orxonox
39{
40    class TESTTESTTEST12
41    {
42        public:
43            TESTTESTTEST12() { this->setMyValue(10); }
44
45        private:
46            void setMyValue(int value) { this->value1_ = value; }
47
48            int value1_;
49            int value2_;
50            Identifier* identifier_;
51    };
52
53    class TESTTESTTEST22
54    {
55        public:
56            TESTTESTTEST22() { this->setMyValue(10); }
57
58        private:
59            void setMyValue(int value) { this->value1_ = value; }
60
61            int value1_;
62            int value2_;
63            double value3_;
64            char value4_;
65            bool value5_;
66            Identifier* identifier1_;
67            Identifier* identifier2_;
68    };
69
70    class TESTTESTTEST32 : virtual public TESTTESTTEST12
71    {
72        public:
73            TESTTESTTEST32() { this->setMyOtherValue(10); }
74
75        private:
76            void setMyOtherValue(int value) { this->value3_ = value; }
77
78            int value3_;
79            TESTTESTTEST22* test_;
80    };
81
82    class _OrxonoxExport Projectile : public TESTTESTTEST22, public TESTTESTTEST32, virtual public TESTTESTTEST12, public WorldEntity
83    {
84        public:
85            virtual ~Projectile();
86            void setConfigValues();
87            void speedChanged();
88            void destroyObject();
89            virtual void tick(float dt);
90            virtual void testfunction();
91
92            static float getSpeed()
93                { return Projectile::speed_s; }
94
95        protected:
96            Projectile(SpaceShip* owner = 0);
97            SpaceShip* owner_;
98
99        private:
100            std::string explosionTemplateName_;
101            std::string smokeTemplateName_;
102        protected:
103            static float speed_s;
104            float speed_;
105        private:
106            float lifetime_;
107            float damage_;
108            Timer<Projectile> destroyTimer_;
109    };
110
111    SUPER_FUNCTION(0, Projectile, testfunction, false);
112}
113
114#endif /* _Projectile_H__ */
Note: See TracBrowser for help on using the repository browser.