代码拉取完成,页面将自动刷新
#include "Trash.h"
#include "gamemap.h"
Trash::Trash(GridVec pos, int name, int direction)
: Building(pos, name, direction)
{
}
bool Trash::IsPlace(const GridVec &click, int picdirection, GameMap &gamemap)
{
// 如果超出地图范围,返回false
if (pos.i < 0 || pos.i >= GameInfo::HEIGHT || pos.j < 0 || pos.j >= GameInfo::WIDTH)
{
return false;
}
// 如果在矿地上,或有障碍物,返回false
if (gamemap.GetResource(pos))
{
return false;
}
// 如果点击的是hub,返回false
if (gamemap.GetBuilding(pos))
{
if (gamemap.GetBuilding(pos)->name == BuildingType::HUB || gamemap.GetBuilding(pos)->name == BuildingType::CUTTER || gamemap.GetBuilding(pos)->name == BuildingType::TRASH)
{
return false;
}
}
return true;
}
std::vector<GridVec> Trash::BuildingAllPos()
{
std::vector<GridVec> result = {pos};
return result;
}
void Trash::Receive(GridVec source, int directionin, int shapename)
{
return;
}
bool Trash::CanReceive(GridVec source, int directionin, int shapename)
{
return true;
}
void Trash::TickableRunning()
{
return;
}
void Trash::UpdateTickableState(GameMap &gamemap)
{
return;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。