Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2010, 5:31:50 AM (15 years ago)
Author:
landauf
Message:

merged ai branch to presentation3

Location:
code/branches/presentation3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/orxonox/controllers/ArtificialController.h

    r6417 r7034  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Dominik Solenicki
    2626 *
    2727 */
     
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include <vector>
     35
    3436#include "util/Math.h"
    3537#include "Controller.h"
     38#include "controllers/NewHumanController.h"
    3639
    3740namespace orxonox
     
    4346            virtual ~ArtificialController();
    4447
     48            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     49
    4550            void abandonTarget(Pawn* target);
    4651
     52            inline void setTeam(int team)
     53                { this->team_ = team; }
     54            inline int getTeam() const
     55                { return this->team_; }
     56            inline void setFormationFlight(bool formation)
     57                { this->formationFlight_ = formation; }
     58            inline bool getFormationFlight() const
     59                { return this->formationFlight_; }
     60            inline void setFormationSize(int size)
     61                { this->maxFormationSize_ = size; }
     62            inline int getFormationSize() const
     63                { return this->maxFormationSize_; }
     64            virtual void changedControllableEntity();
     65
     66            static void formationflight(bool form);
     67            static void masteraction(int action);
     68            static void followme();
     69            static void passivebehaviour(bool passive);
     70            static void formationsize(int size);
     71
    4772        protected:
     73
     74            int team_;
     75            bool formationFlight_;
     76            bool passive_;
     77            unsigned int maxFormationSize_;
     78            int freedomCount_;
     79            enum State {SLAVE, MASTER, FREE};
     80            State state_;
     81            std::vector<ArtificialController*> slaves_;
     82            ArtificialController *myMaster_;
     83            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOWHUMAN};
     84            SpecificMasterAction specificMasterAction_;
     85            int specificMasterActionHoldCount_;
     86            Pawn* humanToFollow_;
     87
    4888            void targetDied();
    4989
    5090            void moveToPosition(const Vector3& target);
    5191            void moveToTargetPosition();
     92
     93            int getState();
     94
     95            void unregisterSlave();
     96            void searchNewMaster();
     97            void commandSlaves();
     98            void setNewMasterWithinFormation();
     99
     100            void freeSlaves();
     101            void forceFreeSlaves();
     102            void loseMasterState();
     103            void forceFreedom();
     104            bool forcedFree();
     105
     106            void specificMasterActionHold();
     107            void turn180Init();
     108            void turn180();
     109            void spinInit();
     110            void spin();
     111            void followHumanInit(Pawn* human, bool always);
     112            void follow();
    52113
    53114            void setTargetPosition(const Vector3& target);
Note: See TracChangeset for help on using the changeset viewer.