2022-06-22 01:51:09 +00:00
|
|
|
|
2022-06-23 05:44:57 +00:00
|
|
|
export function flag(x, y, data, player) {
|
|
|
|
let tile = data[x][y]
|
2022-06-22 01:51:09 +00:00
|
|
|
|
|
|
|
if (!tile.mask || tile.color === 0) return data
|
|
|
|
const color = player.color * 1
|
|
|
|
console.log(player)
|
|
|
|
|
|
|
|
switch (tile.flag) {
|
|
|
|
case (0):
|
|
|
|
tile.flag = color;
|
|
|
|
break;
|
|
|
|
case (color):
|
|
|
|
tile.flag = color + 16;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
tile.flag = 0;
|
|
|
|
}
|
|
|
|
console.log(tile.flag)
|
2022-06-23 05:44:57 +00:00
|
|
|
data[x][y] = tile
|
2022-06-22 01:51:09 +00:00
|
|
|
return data;
|
|
|
|
}
|