Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/modularships/src/orxonox/items/PartDestructionEvent.h @ 10053

Last change on this file since 10053 was 10053, checked in by noep, 11 years ago

Fixed yet another segfault (which we hadn't seen yet).
Cleared emptyLevel, created two testlevels (testing with boxes)

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 *      Noe Pedrazzini
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _PartDestructionEvent_H__
30#define _PartDestructionEvent_H__
31
32#include "OrxonoxPrereqs.h"
33#include "Item.h"
34
35#include <string>
36
37
38namespace orxonox // tolua_export
39{ // tolua_export
40    class _OrxonoxExport PartDestructionEvent // tolua_export
41        : public Item
42    { // tolua_export
43
44        public:
45
46            enum TargetParam
47            {
48                shieldhealth,
49                maxshieldhealth,
50                shieldabsorption,
51                shieldrechargerate,
52                null
53            };
54
55            PartDestructionEvent(Context* context);
56            virtual ~PartDestructionEvent();
57
58            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
59
60            void execute();
61
62            inline void setValid(bool valid)
63                { this->valid_ = valid; }
64            inline bool isValid()
65                { return this->valid_; }
66
67            void setParent(ShipPart* parent);
68            inline ShipPart* getParent()
69                { return this->parent_; }
70
71            void setTargetType(std::string type);
72            inline std::string getTargetType()
73                { return this->targetType_; }
74
75            void setTargetName(std::string name);
76            inline std::string getTargetName()
77                { return this->targetName_; }
78
79            void setTargetParam(std::string param);
80            inline std::string getTargetParam()
81                { return this->targetName_; }
82
83            void setOperation(std::string operation);
84            inline std::string getOperation()
85                { return this->operation_; }
86
87            float operate(float input);
88
89            void setEventValue(float value);
90            inline float getEventValue()
91                { return this->value_; }
92
93        protected:
94
95        private:
96
97            ShipPart* parent_;
98            bool valid_;
99
100            std::string targetType_;
101            std::string targetName_;
102            TargetParam targetParam_;
103            std::string operation_;
104
105            float value_;
106
107
108    }; // tolua_export
109} // tolua_export
110
111#endif /* _PartDestructionEvent_H__ */
Note: See TracBrowser for help on using the repository browser.