state.cpp

来自「巫魔世界是一个被墙所环绕的二维格子世界」· C++ 代码 · 共 16 行

CPP
16
字号

#include"wupus.h"
bool Wupus_World::current(const Object OBJECT)
{
  if(world[hunter.pos->x][hunter.pos->y]==OBJECT)
    return true;
  return false;  
}


void Wupus_World::set_percepts()
{
  hunter.percept.stench= (adjacent(Living_Wupus) ||adjacent(Dead_Wupus) || current(Dead_Wupus));
  hunter.percept.breeze= adjacent(Pit);
  hunter.percept.glitter=current(Gold);
}

⌨️ 快捷键说明

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