Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 24, 2015, 11:54:47 AM (9 years ago)
Author:
gania
Message:

I hope that you don't code today, that version is not compilable just yet

Location:
code/branches/campaignHS15/src/orxonox/worldentities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/worldentities/ActionPoint.cc

    r10844 r10847  
    2727 */
    2828
    29 #include "ActionPoint.h"
     29#include "Actionpoint.h"
    3030
    3131#include "core/CoreIncludes.h"
     
    3434namespace orxonox
    3535{
    36     RegisterClass(ActionPoint);
     36    RegisterClass(Actionpoint);
    3737
    38     ActionPoint::ActionPoint(Context* context) : StaticEntity(context)
     38    Actionpoint::Actionpoint(Context* context) : StaticEntity(context)
    3939    {
    40         RegisterObject(ActionPoint);
     40        RegisterObject(Actionpoint);
    4141
    4242    }
    4343    //usage:
    4444    // <DivisionController team=12>
    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>
     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>
    5050    // </DivisonController>
    5151    //DivisionController will firstly fight enemy that it will find by name "enemyName", if finds nothing or when beats enemy,
     
    5656    //another usage:
    5757    // <DivisionController team=12>
    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>
     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>
    6262    // </DivisonController>
    6363    //DivisionController will protect the first NewHumanController it finds, when it dies or if no controller found,
    6464    //it will fight closest enemies one after another
    65     void ActionPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     65    void Actionpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6666    {
    67         SUPER(ActionPoint, XMLPort, xmlelement, mode);
     67        SUPER(Actionpoint, XMLPort, xmlelement, mode);
    6868       
    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);
     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);
    7474
    7575    }
    76     void ActionPoint::setActionXML( std::string val)
     76    void Actionpoint::setActionXML( std::string val)
    7777    {
    7878        this->actionName_ = getUppercase( val );
     79        orxout(internal_error) << "action = " << this->actionName_ << endl;
    7980    }
    8081
    81     std::string ActionPoint::getActionXML()
     82    std::string Actionpoint::getActionXML()
    8283    {
    8384        return this->actionName_;
    8485    }
    85     void ActionPoint::setProtectXML( std::string val)
     86    void Actionpoint::setProtectXML( std::string val)
    8687    {
    8788        this->protectName_ = getUppercase( val );
    8889    }
    8990
    90     std::string ActionPoint::getProtectXML()
     91    std::string Actionpoint::getProtectXML()
    9192    {
    9293        return this->protectName_;
    9394    }
    94     void ActionPoint::setEnemyXML( std::string val)
     95    void Actionpoint::setEnemyXML( std::string val)
    9596    {
    9697        this->enemyName_ = getUppercase( val );
    9798    }
    9899
    99     std::string ActionPoint::getEnemyXML()
     100    std::string Actionpoint::getEnemyXML()
    100101    {
    101102        return this->enemyName_;
    102103    }
    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)
    105121    {
    106122        this->targetPosition_ = target;
    107123    }
    108     Vector3 ActionPoint::getTargetPosition ()
     124    Vector3 Actionpoint::getTargetPosition ()
    109125    {
    110126        return this->targetPosition_;
  • code/branches/campaignHS15/src/orxonox/worldentities/ActionPoint.h

    r10844 r10847  
    3333*/
    3434
    35 #ifndef _ActionPoint_H__
    36 #define _ActionPoint_H__
     35#ifndef _Actionpoint_H__
     36#define _Actionpoint_H__
    3737
    3838#include "OrxonoxPrereqs.h"
     
    4545{
    4646 
    47     class _OrxonoxExport ActionPoint : public StaticEntity
     47    class _OrxonoxExport Actionpoint : public StaticEntity
    4848    {
    4949        public:
    50             ActionPoint(Context* context);
    51             virtual ~ActionPoint() {}
     50            Actionpoint(Context* context);
     51            virtual ~Actionpoint() {}
    5252
    5353            //----[XML data]----
     
    8787                //----[/FightAll data]----
    8888            //----[/XML data]----
    89 
     89                void setProtect( ControllableEntity* protect);
     90                ControllableEntity* getProtect();
     91                void setEnemy( ControllableEntity* enemy);
     92                ControllableEntity* getEnemy();
    9093            //----["Waypoints" data]----
    9194                void setTargetPosition(const Vector3& target);
     
    98101            std::string protectName_;
    99102            std::string enemyName_;
     103            WeakPtr<ControllableEntity> protect_;
     104            WeakPtr<ControllableEntity> enemy_;
     105
    100106            bool protectMe_;
    101107            bool fightAll_;
     
    104110}
    105111
    106 #endif /* _ActionPoint_H__ */
     112#endif /* _Actionpoint_H__ */
  • code/branches/campaignHS15/src/orxonox/worldentities/CMakeLists.txt

    r10843 r10847  
    1212  SpawnPoint.cc
    1313  TeamSpawnPoint.cc
    14   ActionPoint.cc
     14  Actionpoint.cc
    1515)
    1616
Note: See TracChangeset for help on using the changeset viewer.