Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/src/orxonox/worldentities/ActionPoint.h @ 10855

Last change on this file since 10855 was 10855, checked in by gania, 8 years ago

introduced loops

File size: 4.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 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file Attacher.h
31    @brief Definition of the Attacher class.
32    @ingroup Objects
33*/
34
35#ifndef _Actionpoint_H__
36#define _Actionpoint_H__
37
38#include "OrxonoxPrereqs.h"
39
40#include <list>
41#include <string>
42#include "core/XMLNameListener.h"
43#include "worldentities/StaticEntity.h"
44namespace orxonox
45{
46 
47    class _OrxonoxExport Actionpoint : public StaticEntity
48    {
49        public:
50            Actionpoint(Context* context);
51            virtual ~Actionpoint() {}
52
53            //----[XML data]----
54                virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
55                //----[Action data]----
56                    void setActionXML( std::string val);
57                    std::string getActionXML();
58                //----[/Action data]----
59                //----[Protect data]----
60                    void setProtectXML( std::string val);
61                    std::string getProtectXML();
62                //----[/Protect data]----
63                //----[Enemy data]----
64                    void setEnemyXML( std::string val);
65                    std::string getEnemyXML();
66                //----[/Enemy data]----
67                //----[ProtectMe data]----
68                    inline void setProtectMeXML(bool c)
69                    {
70                        this->bProtectMe_ = c;
71                    }
72                    inline bool getProtectMeXML ()
73                    {
74                        return this->bProtectMe_;
75                    }
76
77                //----[/ProtectMe data]----
78                //----[FightAll data]----
79                    inline void setFightAllXML(bool c)
80                    {
81                        this->bFightAll_ = c;
82                    }
83                    inline bool getFightAllXML ()
84                    {
85                        return this->bFightAll_;
86                    }
87                //----[/FightAll data]----
88            //----[/XML data]----
89                void setProtect( ControllableEntity* protect);
90                ControllableEntity* getProtect();
91                void setEnemy( ControllableEntity* enemy);
92                ControllableEntity* getEnemy();
93                std::string getName()
94                {
95                    if (actionName_ != "")
96                        return actionName_;
97                    else if (protectName_ != "")
98                        return protectName_;
99                    else if (enemyName_ != "")
100                        return enemyName_;
101                    else
102                        return "";
103                }
104                void setLoopStart(bool value)
105                {
106                    this->bLoopStart_ = value;
107                }
108                void setLoopEnd (bool value)
109                {
110                    this->bLoopEnd_ = value;
111                }
112            //----["Waypoints" data]----
113                void setTargetPosition(const Vector3& target);
114                Vector3 getTargetPosition ();
115            //----[/"Waypoints" data]----
116
117            bool getLoopStart()
118            {
119                return this->bLoopStart_;
120            }
121            bool getLoopEnd();
122            {
123                return this->bLoopEnd_;
124            }
125        private:
126           
127            std::string actionName_;
128            std::string protectName_;
129            std::string enemyName_;
130            WeakPtr<ControllableEntity> protect_;
131            WeakPtr<ControllableEntity> enemy_;
132
133            bool bLoopStart_;
134            bool bLoopEnd_;
135            bool bProtectMe_;
136            bool bFightAll_;
137            Vector3 targetPosition_;
138    };
139}
140
141#endif /* _Actionpoint_H__ */
Note: See TracBrowser for help on using the repository browser.