| [10844] | 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 |  | 
|---|
| [10847] | 35 | #ifndef _Actionpoint_H__ | 
|---|
 | 36 | #define _Actionpoint_H__ | 
|---|
| [10844] | 37 |  | 
|---|
 | 38 | #include "OrxonoxPrereqs.h" | 
|---|
 | 39 |  | 
|---|
 | 40 | #include <list> | 
|---|
 | 41 | #include <string> | 
|---|
 | 42 | #include "core/XMLNameListener.h" | 
|---|
 | 43 | #include "worldentities/StaticEntity.h" | 
|---|
 | 44 | namespace orxonox | 
|---|
 | 45 | { | 
|---|
 | 46 |   | 
|---|
| [10847] | 47 |     class _OrxonoxExport Actionpoint : public StaticEntity | 
|---|
| [10844] | 48 |     { | 
|---|
 | 49 |         public: | 
|---|
| [10847] | 50 |             Actionpoint(Context* context); | 
|---|
 | 51 |             virtual ~Actionpoint() {} | 
|---|
| [10844] | 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->protectMe_ = c; | 
|---|
 | 71 |                     } | 
|---|
 | 72 |                     inline bool getProtectMeXML () | 
|---|
 | 73 |                     { | 
|---|
 | 74 |                         return this->protectMe_; | 
|---|
 | 75 |                     } | 
|---|
 | 76 |  | 
|---|
 | 77 |                 //----[/ProtectMe data]---- | 
|---|
 | 78 |                 //----[FightAll data]---- | 
|---|
 | 79 |                     inline void setFightAllXML(bool c) | 
|---|
 | 80 |                     { | 
|---|
 | 81 |                         this->fightAll_ = c; | 
|---|
 | 82 |                     } | 
|---|
 | 83 |                     inline bool getFightAllXML () | 
|---|
 | 84 |                     { | 
|---|
 | 85 |                         return this->fightAll_; | 
|---|
 | 86 |                     } | 
|---|
 | 87 |                 //----[/FightAll data]---- | 
|---|
 | 88 |             //----[/XML data]---- | 
|---|
| [10847] | 89 |                 void setProtect( ControllableEntity* protect); | 
|---|
 | 90 |                 ControllableEntity* getProtect(); | 
|---|
 | 91 |                 void setEnemy( ControllableEntity* enemy); | 
|---|
 | 92 |                 ControllableEntity* getEnemy(); | 
|---|
| [10848] | 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 |                 } | 
|---|
| [10844] | 104 |             //----["Waypoints" data]---- | 
|---|
 | 105 |                 void setTargetPosition(const Vector3& target); | 
|---|
 | 106 |                 Vector3 getTargetPosition (); | 
|---|
 | 107 |             //----[/"Waypoints" data]---- | 
|---|
 | 108 |  | 
|---|
 | 109 |         private: | 
|---|
 | 110 |              | 
|---|
 | 111 |             std::string actionName_; | 
|---|
 | 112 |             std::string protectName_; | 
|---|
 | 113 |             std::string enemyName_; | 
|---|
| [10847] | 114 |             WeakPtr<ControllableEntity> protect_; | 
|---|
 | 115 |             WeakPtr<ControllableEntity> enemy_; | 
|---|
 | 116 |  | 
|---|
| [10844] | 117 |             bool protectMe_; | 
|---|
 | 118 |             bool fightAll_; | 
|---|
 | 119 |             Vector3 targetPosition_; | 
|---|
 | 120 |     }; | 
|---|
 | 121 | } | 
|---|
 | 122 |  | 
|---|
| [10847] | 123 | #endif /* _Actionpoint_H__ */ | 
|---|