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

📄 perceptor.cpp

📁 巫魔问题求解
💻 CPP
字号:
#include "Perceptor.h"
#include "WorldModel.h"

using namespace _algorithm;

/////////////////////////////////////////////////
Perceptor::Perceptor(WorldModel &wm, _server::AlgorithmInterface &ai)
{
    mpWorldModel = &wm;
    mpAlgorithmInterface = &ai;
}

///////////////////////////////////////////////////
Perceptor::~Perceptor(void)
{
}

///////////////////////////////////////////////////
Perceptor::Perceptor(const _algorithm::Perceptor &from)
{
}

///////////////////////////////////////////////////
WorldModel &Perceptor::TheWorldModel(void)
{
    return *mpWorldModel;
}

///////////////////////////////////////////////////
void Perceptor::UpdateWorldModel(void)
{
    WorldModel::Info & info = this->TheWorldModel().TheInfo();
    _server::AlgorithmInterface::ServerToClient &s2c = this->mpAlgorithmInterface->TheServerToClient();

    this->mpAlgorithmInterface->Update();

    if (s2c.mIsReset)
    {
        this->TheWorldModel().Reset();
    }
    info.mDirection = s2c.mDirection;
    info.mIsBreeze = s2c.mIsBreeze;
    info.mIsBump = s2c.mIsBump;
    info.mIsGleam = s2c.mIsGleam;
    info.mIsHowl = s2c.mIsHowl;
    info.mIsStench = s2c.mIsStench;
    info.mPositionX = s2c.mPositionX;
    info.mPositionY = s2c.mPositionY;

    this->TheWorldModel().TheClientMap().Update();
}

⌨️ 快捷键说明

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