Changeset 10847 for code/branches/campaignHS15/src/orxonox/worldentities
- Timestamp:
- Nov 24, 2015, 11:54:47 AM (9 years ago)
- Location:
- code/branches/campaignHS15/src/orxonox/worldentities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/worldentities/ActionPoint.cc
r10844 r10847 27 27 */ 28 28 29 #include "Action Point.h"29 #include "Actionpoint.h" 30 30 31 31 #include "core/CoreIncludes.h" … … 34 34 namespace orxonox 35 35 { 36 RegisterClass(Action Point);36 RegisterClass(Actionpoint); 37 37 38 Action Point::ActionPoint(Context* context) : StaticEntity(context)38 Actionpoint::Actionpoint(Context* context) : StaticEntity(context) 39 39 { 40 RegisterObject(Action Point);40 RegisterObject(Actionpoint); 41 41 42 42 } 43 43 //usage: 44 44 // <DivisionController team=12> 45 // < actionpoints>46 // <Action Point position="12,34,56" action="FIGHT" enemy="enemyName" />, position irrelevant47 // <Action Point position="12,34,56" action="PROTECT" protect="protectName" />, position irrelevant48 // <Action Point position="12,34,56" action="FLY" />, position relevant: makes ship fly to the position of ActionPoint49 // </ actionpoints>45 // <Actionpoints> 46 // <Actionpoint position="12,34,56" action="FIGHT" enemy="enemyName" />, position irrelevant 47 // <Actionpoint position="12,34,56" action="PROTECT" protect="protectName" />, position irrelevant 48 // <Actionpoint position="12,34,56" action="FLY" />, position relevant: makes ship fly to the position of Actionpoint 49 // </Actionpoints> 50 50 // </DivisonController> 51 51 //DivisionController will firstly fight enemy that it will find by name "enemyName", if finds nothing or when beats enemy, … … 56 56 //another usage: 57 57 // <DivisionController team=12> 58 // < actionpoints>59 // <Action Point position="12,34,56" action="PROTECT" protectMe=true />, position irrelevant60 // <Action Point position="12,34,56" action="FIGHT" fightAll=true />, position irrelevant61 // </ actionpoints>58 // <Actionpoints> 59 // <Actionpoint position="12,34,56" action="PROTECT" protectMe=true />, position irrelevant 60 // <Actionpoint position="12,34,56" action="FIGHT" fightAll=true />, position irrelevant 61 // </Actionpoints> 62 62 // </DivisonController> 63 63 //DivisionController will protect the first NewHumanController it finds, when it dies or if no controller found, 64 64 //it will fight closest enemies one after another 65 void Action Point::XMLPort(Element& xmlelement, XMLPort::Mode mode)65 void Actionpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 66 66 { 67 SUPER(Action Point, XMLPort, xmlelement, mode);67 SUPER(Actionpoint, XMLPort, xmlelement, mode); 68 68 69 XMLPortParam( Action Point, "action", setActionXML, getActionXML, xmlelement, mode );70 XMLPortParam( Action Point, "protect", setProtectXML, getProtectXML, xmlelement, mode );71 XMLPortParam( Action Point, "enemy", setEnemyXML, getEnemyXML, xmlelement, mode );72 XMLPortParam( Action Point, "protectMe", setProtectMeXML, getProtectMeXML, xmlelement, mode ).defaultValues(false);73 XMLPortParam( Action Point, "fightAll", setFightAllXML, getFightAllXML, xmlelement, mode ).defaultValues(false);69 XMLPortParam( Actionpoint, "action", setActionXML, getActionXML, xmlelement, mode ); 70 XMLPortParam( Actionpoint, "protect", setProtectXML, getProtectXML, xmlelement, mode ); 71 XMLPortParam( Actionpoint, "enemy", setEnemyXML, getEnemyXML, xmlelement, mode ); 72 XMLPortParam( Actionpoint, "protectMe", setProtectMeXML, getProtectMeXML, xmlelement, mode ).defaultValues(false); 73 XMLPortParam( Actionpoint, "fightAll", setFightAllXML, getFightAllXML, xmlelement, mode ).defaultValues(false); 74 74 75 75 } 76 void Action Point::setActionXML( std::string val)76 void Actionpoint::setActionXML( std::string val) 77 77 { 78 78 this->actionName_ = getUppercase( val ); 79 orxout(internal_error) << "action = " << this->actionName_ << endl; 79 80 } 80 81 81 std::string Action Point::getActionXML()82 std::string Actionpoint::getActionXML() 82 83 { 83 84 return this->actionName_; 84 85 } 85 void Action Point::setProtectXML( std::string val)86 void Actionpoint::setProtectXML( std::string val) 86 87 { 87 88 this->protectName_ = getUppercase( val ); 88 89 } 89 90 90 std::string Action Point::getProtectXML()91 std::string Actionpoint::getProtectXML() 91 92 { 92 93 return this->protectName_; 93 94 } 94 void Action Point::setEnemyXML( std::string val)95 void Actionpoint::setEnemyXML( std::string val) 95 96 { 96 97 this->enemyName_ = getUppercase( val ); 97 98 } 98 99 99 std::string Action Point::getEnemyXML()100 std::string Actionpoint::getEnemyXML() 100 101 { 101 102 return this->enemyName_; 102 103 } 103 104 void ActionPoint::setTargetPosition(const Vector3& target) 104 void Actionpoint::setProtect( ControllableEntity* protect) 105 { 106 this->protect_ = protect; 107 } 108 ControllableEntity* Actionpoint::getProtect() 109 { 110 return this->protect_; 111 } 112 void Actionpoint::setEnemy( ControllableEntity* enemy) 113 { 114 this->enemy_ = enemy; 115 } 116 ControllableEntity* Actionpoint::getEnemy() 117 { 118 return this->enemy_; 119 } 120 void Actionpoint::setTargetPosition(const Vector3& target) 105 121 { 106 122 this->targetPosition_ = target; 107 123 } 108 Vector3 Action Point::getTargetPosition ()124 Vector3 Actionpoint::getTargetPosition () 109 125 { 110 126 return this->targetPosition_; -
code/branches/campaignHS15/src/orxonox/worldentities/ActionPoint.h
r10844 r10847 33 33 */ 34 34 35 #ifndef _Action Point_H__36 #define _Action Point_H__35 #ifndef _Actionpoint_H__ 36 #define _Actionpoint_H__ 37 37 38 38 #include "OrxonoxPrereqs.h" … … 45 45 { 46 46 47 class _OrxonoxExport Action Point : public StaticEntity47 class _OrxonoxExport Actionpoint : public StaticEntity 48 48 { 49 49 public: 50 Action Point(Context* context);51 virtual ~Action Point() {}50 Actionpoint(Context* context); 51 virtual ~Actionpoint() {} 52 52 53 53 //----[XML data]---- … … 87 87 //----[/FightAll data]---- 88 88 //----[/XML data]---- 89 89 void setProtect( ControllableEntity* protect); 90 ControllableEntity* getProtect(); 91 void setEnemy( ControllableEntity* enemy); 92 ControllableEntity* getEnemy(); 90 93 //----["Waypoints" data]---- 91 94 void setTargetPosition(const Vector3& target); … … 98 101 std::string protectName_; 99 102 std::string enemyName_; 103 WeakPtr<ControllableEntity> protect_; 104 WeakPtr<ControllableEntity> enemy_; 105 100 106 bool protectMe_; 101 107 bool fightAll_; … … 104 110 } 105 111 106 #endif /* _Action Point_H__ */112 #endif /* _Actionpoint_H__ */ -
code/branches/campaignHS15/src/orxonox/worldentities/CMakeLists.txt
r10843 r10847 12 12 SpawnPoint.cc 13 13 TeamSpawnPoint.cc 14 Action Point.cc14 Actionpoint.cc 15 15 ) 16 16
Note: See TracChangeset
for help on using the changeset viewer.