代码拉取完成,页面将自动刷新
#pragma once
#include <vector>
#include "GameGlobal.h"
#define SIZE_SQUARE 40
#define SIZE_WALL 8
#define STARTAXIS_X 280
#define STARTAXIS_Y 105
struct Region {
int x = 0;
int y = 0;
int numx = 0;
int numy = 0;
bool isBoardOn(Point point) {
bool flag = false;
if (point.row < x + 15 && point.row > x - 15 && point.col < y + 15 && point.col > y - 15)
flag = true;
return flag;
}
bool isWallOn(int type, Point point) {
bool flag = false;
if (type == 0 && point.row < x + 15 && point.row > x - 15 && point.col < y + 4 && point.col > y - 4)
flag = true;
if (type == 1 && point.row < x + 4 && point.row > x - 4 && point.col < y + 15 && point.col > y - 15)
flag = true;
return flag;
}
};
class GameDisplay
{
public:
GameDisplay(void);
~GameDisplay(void) = default;
CRect getPlayerRegion(Point point) const;
CRect getWallRegion(std::pair<Point, int> wall) const;
std::vector<CRect> getWallRegion(std::vector<std::pair<Point, int>> wall) const;
bool isBoardOn(Point point, Region region) const;
bool isWallOn(int type, Point point, Region region) const;
Order getPositionToOrder(Point point) const;
private:
std::vector<Region> mRegionBoard;
std::vector<Region> mRegionWall[2];
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。