⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plan.h

📁 巫魔问题求解
💻 H
字号:
#pragma once
#include <vector>

namespace _base
{
    class Cell;
}

namespace _algorithm
{
    class WorldModel;
    class Effector;
    class Thinker;

    class Plan
    {
    public:
        //type TPath
        typedef std::vector<_base::Cell*> TPath;
        //operations
        enum eOperations
        {
            O_TurnLeft,
            O_TurnRight,
            O_GoAhead,
            O_Escape,
            O_Shoot,
        };

    public:
        //constructor and destructor
        Plan(WorldModel &wm, Effector &eff);
        ~Plan(void);

    private:
        //disable copy constructor
        Plan(const Plan &from);

    public:
        //step
        void Step(void);

    protected:
        //get informations from the clientmap from worldmodel, and generate the target place
        _base::Cell* GenTargetPlace(void);
        //generate a path according to from and to,
        //from and to are ids from TheClientMap().TheSafeCells()
        TPath GenPath(int from, int to);
        //generate a new task, currently just support one operation per step
        void GenTasks(void);
        //execute an operation
        void ExeDecision(void);
        //unused, for generation escape operations
        void GenEscape(void);
        //unused, to judge if there is new information being needed
        bool IsNeedNewInfo(void);

    public:
        //references
        WorldModel &TheWorldModel(void);
        const WorldModel &GetWorldModel(void) const;
        Effector &TheEffector(void);
        const Effector &GetEffector(void) const;
        Thinker &TheThinker(void);
        const Thinker &GetThinker(void) const;
    
    protected: 
        //generate paths, and get the head of the paths to generate tasks, then execute
        std::vector<TPath> mPaths;
        std::vector<eOperations> mTasks;
        WorldModel *mpWorldModel;
        Effector *mpEffector;
        Thinker *mpThinker;
    };
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -