Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2015, 9:08:11 AM (10 years ago)
Author:
gania
Message:

split up some code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/CommonController.h

    r10861 r10864  
    6161
    6262    }
    63     namespace Action
    64     { 
    65         enum Value
    66         {
    67             NONE, FLY, FIGHT, PROTECT, FIGHTALL, ATTACK
    68         };
    69        
    70     }
    71    
    72     struct Point {
    73         Action::Value action;
    74         std::string name;
    75         Vector3 position;
    76         bool inLoop;
    77     } ;
    78 
     63   
    7964
    8065   
     
    9681                virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    9782               
    98                     void setFormationModeXML(std::string val);
    99                     std::string getFormationModeXML();
    100                     void setFormationMode(FormationMode::Value val);
    101                     FormationMode::Value getFormationMode() const;
     83                void setFormationModeXML(std::string val);
     84                std::string getFormationModeXML();
     85                void setFormationMode(FormationMode::Value val);
     86                FormationMode::Value getFormationMode() const;
    10287
    103                     void setRank(Rank::Value val);
    104                     Rank::Value getRank() const;
    105                
    106                     void addActionpoint(WorldEntity* waypoint);
    107                     WorldEntity* getActionpoint(unsigned int index) const;
     88                void setRank(Rank::Value val);
     89                Rank::Value getRank() const;
     90           
     91
    10892            //----[/XML methods]----
    10993
     
    11599                ControllableEntity* getTarget();
    116100                     
    117                 Action::Value getAction ();
    118                 std::string getActionName();
    119 
    120                 void setAction (Action::Value action);
    121                 void setAction (Action::Value action, ControllableEntity* target);
    122                 void setAction (Action::Value action, const Vector3& target);
    123                 void setAction (Action::Value action, const Vector3& target,  const Quaternion& orient );
    124             //----[/Interaction with other Controllers]----
     101             //----[/Interaction with other Controllers]----
    125102
    126103            //----[Helper methods]----
     
    135112            //----[/Helper methods]----
    136113
    137              
    138                 virtual void stayNearProtect();
    139                 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour.
    140                  virtual void takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b);
    141    
     114 
    142115        protected:
    143116            //----[Flying methods]----
     
    168141                void setOrientationOfTarget(const Quaternion& orient);
    169142
    170                 void setProtect (ControllableEntity* protect);
    171                 ControllableEntity* getProtect ();
    172143
    173144                void maneuver();
     
    175146                bool canFire();
    176147                void doFire();
    177                 void setClosestTarget();
    178                 Pawn* closestTarget();
    179                 void startAttackingEnemiesThatAreClose();
     148
    180149            //----[/Fighting methods]----           
    181150           
     
    200169            //----[/who-to-kill information]----
    201170
    202             //----[Actionpoint information]----
    203171
    204                 std::vector<WeakPtr<WorldEntity> > actionpoints_;
    205                 float squaredaccuracy_;
    206                 std::vector<Point > parsedActionpoints_;
    207                 std::vector<Point > loopActionpoints_;
    208 
    209             //----[/Actionpoint information]----
    210             //----[Actionpoint methods]----
    211                 void executeActionpoint();
    212                 void nextActionpoint();
    213                 void fillLoop();
    214                 void fillLoopReversed();
    215                 void moveBackToTop();
    216             //----[Actionpoint methods]----
    217172            //----["Private" variables]----
    218173                FormationMode::Value formationMode_;
    219174                Rank::Value rank_;
    220                 std::string protectName_;
    221                 std::string targetName_;
    222                 Action::Value action_;
     175
    223176                int attackRange_;
    224177                bool bLookAtTarget_;       
     
    227180                int tolerance_;
    228181                bool bFirstTick_;
    229                 bool bInLoop_;
    230                 bool bLoop_;   
    231                 bool bEndLoop_; 
    232                 bool bTakenOver_;             
     182           
    233183            //----[/"Private" variables]----   
    234184           
Note: See TracChangeset for help on using the changeset viewer.