Compare commits
1 Commits
master
...
create-mov
Author | SHA1 | Date | |
---|---|---|---|
52523fccdc |
13
api.go
13
api.go
@ -49,7 +49,7 @@ func (a *API) NewGame(res http.ResponseWriter, req *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("creating new game %v", a.nextInt)
|
log.Printf("creating new game %v", a.nextInt)
|
||||||
a.games[a.nextInt] = NewSession(8)
|
a.games[a.nextInt] = NewSession()
|
||||||
a.games[a.nextInt].redPlayer.Ready = true
|
a.games[a.nextInt].redPlayer.Ready = true
|
||||||
respondWithJSON(res, http.StatusOK, newGameResp{a.nextInt, "red"})
|
respondWithJSON(res, http.StatusOK, newGameResp{a.nextInt, "red"})
|
||||||
a.nextInt = a.nextInt + 1
|
a.nextInt = a.nextInt + 1
|
||||||
@ -81,16 +81,7 @@ func (a *API) GetGame(res http.ResponseWriter, req *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Println("sending game state")
|
log.Println("sending game state")
|
||||||
board := s.getBoard(p)
|
respondWithJSON(res, http.StatusOK, gameResp{s.getBoard(p)})
|
||||||
rotate := req.Header.Get("Rotate")
|
|
||||||
if rotate == "true" {
|
|
||||||
log.Println("rotating output")
|
|
||||||
//rotateBoard(board)
|
|
||||||
//rotateBoard(board)
|
|
||||||
//rotateBoard(board)
|
|
||||||
|
|
||||||
}
|
|
||||||
respondWithJSON(res, http.StatusOK, gameResp{board})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
122
api_test.go
122
api_test.go
@ -1,122 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"strconv"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestNewAPI(t *testing.T) {
|
|
||||||
a := NewAPI()
|
|
||||||
if len(a.games) != 0 {
|
|
||||||
t.Fatalf("games list not empty")
|
|
||||||
}
|
|
||||||
if a.nextInt != 1 {
|
|
||||||
t.Fatalf("nextInt somehow already implemented")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func dummyGame(a *API) int {
|
|
||||||
i := a.nextInt
|
|
||||||
a.games[i] = NewSession(8)
|
|
||||||
a.games[i].redPlayer.Ready = true
|
|
||||||
a.games[i].bluePlayer.Ready = true
|
|
||||||
a.games[i].simulator.Setup()
|
|
||||||
initDummy(a.games[i].simulator)
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestNewGame(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
a := NewAPI()
|
|
||||||
var tests = []struct {
|
|
||||||
gid int
|
|
||||||
pid string
|
|
||||||
}{
|
|
||||||
{1, "red"},
|
|
||||||
{1, "blue"},
|
|
||||||
{2, "red"},
|
|
||||||
}
|
|
||||||
for i, tt := range tests {
|
|
||||||
tname := fmt.Sprintf("/game %v", i)
|
|
||||||
t.Run(tname, func(t *testing.T) {
|
|
||||||
r, _ := http.NewRequest("POST", "/game", nil)
|
|
||||||
w := httptest.NewRecorder()
|
|
||||||
a.NewGame(w, r)
|
|
||||||
resp := w.Result()
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
|
||||||
t.Fatal("failed to create new game")
|
|
||||||
}
|
|
||||||
_, ok := a.games[tt.gid]
|
|
||||||
if !ok {
|
|
||||||
t.Fatalf("API thinks it created a game but it didn't")
|
|
||||||
}
|
|
||||||
var respStruct newGameResp
|
|
||||||
err := json.NewDecoder(resp.Body).Decode(&respStruct)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("/game returned bad response body: %v", err)
|
|
||||||
}
|
|
||||||
if respStruct.GameID != tt.gid {
|
|
||||||
t.Errorf("Expected game %v, got %v", tt.gid, respStruct.GameID)
|
|
||||||
}
|
|
||||||
if respStruct.PlayerID != tt.pid {
|
|
||||||
t.Errorf("wrong playerID returned")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetGame(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
a := NewAPI()
|
|
||||||
gid := dummyGame(a)
|
|
||||||
var tests = []struct {
|
|
||||||
pid string
|
|
||||||
code int
|
|
||||||
}{
|
|
||||||
{"red", http.StatusOK},
|
|
||||||
{"blue", http.StatusOK},
|
|
||||||
{"green", http.StatusBadRequest},
|
|
||||||
}
|
|
||||||
for _, tt := range tests {
|
|
||||||
tname := fmt.Sprintf("/game from player %v", tt.pid)
|
|
||||||
t.Run(tname, func(t *testing.T) {
|
|
||||||
r, _ := http.NewRequest("GET", "/game", nil)
|
|
||||||
w := httptest.NewRecorder()
|
|
||||||
r = mux.SetURLVars(r, map[string]string{"id": strconv.Itoa(gid)})
|
|
||||||
r.Header.Add("Player-id", tt.pid)
|
|
||||||
r.Header.Add("Rotate", "false")
|
|
||||||
a.GetGame(w, r)
|
|
||||||
resp := w.Result()
|
|
||||||
if resp.StatusCode != tt.code {
|
|
||||||
t.Fatalf("failed to get game: %v", resp.Status)
|
|
||||||
}
|
|
||||||
if resp.StatusCode == http.StatusOK {
|
|
||||||
var respStruct gameResp
|
|
||||||
err := json.NewDecoder(resp.Body).Decode(&respStruct)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("/game returned bad response body: %v", err)
|
|
||||||
}
|
|
||||||
if len(respStruct.GameBoard) == 0 {
|
|
||||||
t.Errorf("bad game board returned")
|
|
||||||
}
|
|
||||||
for j := range respStruct.GameBoard {
|
|
||||||
for i, vt := range respStruct.GameBoard[j] {
|
|
||||||
curr, err := a.games[gid].simulator.Board.GetPiece(i, j)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Strange board position: %v", err)
|
|
||||||
}
|
|
||||||
if curr != nil && !vt.Hidden && curr.Owner.String() != tt.pid && curr.Hidden {
|
|
||||||
t.Errorf("/game returned a piece that should be hidden but isn't")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,7 @@ type newGameResp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type gameResp struct {
|
type gameResp struct {
|
||||||
GameBoard [][]*ViewTile `json:"board"`
|
GameBoard [8][8]*ViewTile `json:"board"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type gameStatusResp struct {
|
type gameStatusResp struct {
|
||||||
|
17
session.go
17
session.go
@ -15,7 +15,6 @@ type Session struct {
|
|||||||
bluePlayer *Player
|
bluePlayer *Player
|
||||||
moveNum int
|
moveNum int
|
||||||
moveList []freego.ParsedCommand
|
moveList []freego.ParsedCommand
|
||||||
boardSize int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Player is a player in a match
|
//Player is a player in a match
|
||||||
@ -35,7 +34,7 @@ func (p *Player) Colour() freego.Colour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//NewSession creates a new game session
|
//NewSession creates a new game session
|
||||||
func NewSession(size int) *Session {
|
func NewSession() *Session {
|
||||||
sim := freego.NewGame()
|
sim := freego.NewGame()
|
||||||
return &Session{
|
return &Session{
|
||||||
simulator: sim,
|
simulator: sim,
|
||||||
@ -43,7 +42,6 @@ func NewSession(size int) *Session {
|
|||||||
bluePlayer: &Player{false, freego.Blue},
|
bluePlayer: &Player{false, freego.Blue},
|
||||||
moveNum: 1,
|
moveNum: 1,
|
||||||
moveList: make([]freego.ParsedCommand, 20),
|
moveList: make([]freego.ParsedCommand, 20),
|
||||||
boardSize: size,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,13 +78,10 @@ func (s *Session) getMove(p *Player, num int) (string, error) {
|
|||||||
return fmt.Sprintf("%v %v", num, s.moveList[num].String()), nil
|
return fmt.Sprintf("%v %v", num, s.moveList[num].String()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Session) getBoard(p *Player) [][]*ViewTile {
|
func (s *Session) getBoard(p *Player) [8][8]*ViewTile {
|
||||||
res := make([][]*ViewTile, s.boardSize)
|
var res [8][8]*ViewTile
|
||||||
for i := range res {
|
for i := 0; i < 8; i++ {
|
||||||
res[i] = make([]*ViewTile, s.boardSize)
|
for j := 0; j < 8; j++ {
|
||||||
}
|
|
||||||
for i := 0; i < s.boardSize; i++ {
|
|
||||||
for j := 0; j < s.boardSize; j++ {
|
|
||||||
cur := NewViewTile()
|
cur := NewViewTile()
|
||||||
terrain, err := s.simulator.Board.IsTerrain(i, j)
|
terrain, err := s.simulator.Board.IsTerrain(i, j)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -114,7 +109,7 @@ func (s *Session) getBoard(p *Player) [][]*ViewTile {
|
|||||||
cur.Empty = true
|
cur.Empty = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res[j][i] = cur
|
res[i][j] = cur
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
@ -5,6 +5,7 @@ COPY package-lock.json .
|
|||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
FROM base as dependencies
|
FROM base as dependencies
|
||||||
|
COPY utils /utils
|
||||||
COPY pages /pages
|
COPY pages /pages
|
||||||
COPY public /public
|
COPY public /public
|
||||||
COPY styles /styles
|
COPY styles /styles
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { Cell } from "../types";
|
import { Cell, Position } from "../types";
|
||||||
|
|
||||||
const USER_ID_HEADER = "Player-id";
|
const USER_ID_HEADER = "Player-id";
|
||||||
|
|
||||||
@ -18,3 +18,27 @@ export const fetchGameState = async (
|
|||||||
cellWidth: response.board[0].length,
|
cellWidth: response.board[0].length,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const submitMove = async (
|
||||||
|
playerId: string,
|
||||||
|
gameId: number,
|
||||||
|
piecePosition: Position,
|
||||||
|
movePosition: Position
|
||||||
|
): Promise<{ cells: Cell[] }> => {
|
||||||
|
console.log(piecePosition, movePosition);
|
||||||
|
const response: { board: Cell[][] } = await wretch(`/api/game/${gameId}/move`)
|
||||||
|
.headers({
|
||||||
|
[USER_ID_HEADER]: playerId,
|
||||||
|
})
|
||||||
|
.body({
|
||||||
|
pieceRow: piecePosition.row,
|
||||||
|
pieceColumn: piecePosition.column,
|
||||||
|
moveRow: movePosition.row,
|
||||||
|
moveColumn: movePosition.column,
|
||||||
|
})
|
||||||
|
.post()
|
||||||
|
.json();
|
||||||
|
return {
|
||||||
|
cells: response.board.flat(),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -1,25 +1,33 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
|
import cn from "classnames";
|
||||||
import { Cell } from "../types";
|
import { Cell } from "../types";
|
||||||
import styles from "../styles/board.module.css";
|
import styles from "../styles/board.module.css";
|
||||||
|
|
||||||
interface BoardProps {
|
interface BoardProps {
|
||||||
cells: Cell[];
|
cells: Cell[];
|
||||||
cellWidth: number;
|
cellWidth: number;
|
||||||
|
focusedCellIndex?: number;
|
||||||
|
onCellClick: (index: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Board = (props: BoardProps) => {
|
const Board = (props: BoardProps) => (
|
||||||
return (
|
<div
|
||||||
<div
|
className={styles.gridContainer}
|
||||||
className={styles.gridContainer}
|
style={{
|
||||||
style={{
|
gridTemplateColumns: `repeat(${props.cellWidth}, 1fr)`,
|
||||||
gridTemplateColumns: `repeat(${props.cellWidth}, 1fr)`,
|
}}
|
||||||
}}
|
>
|
||||||
>
|
{props.cells.map((cell, i) => (
|
||||||
{props.cells.map((cell) => (
|
<button
|
||||||
<div className={styles.gridCell}>{cell.piece}</div>
|
className={cn(styles.gridCell, {
|
||||||
))}
|
[styles.cellClicked]: i === props.focusedCellIndex,
|
||||||
</div>
|
})}
|
||||||
);
|
onClick={() => props.onCellClick(i)}
|
||||||
};
|
>
|
||||||
|
{cell.piece}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
export default Board;
|
export default Board;
|
||||||
|
@ -1,19 +1,42 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { fetchGameState } from "../api/game.api";
|
import { fetchGameState, submitMove } from "../api/game.api";
|
||||||
|
import { convertIndexToPosition } from "../utils/position";
|
||||||
import { Cell } from "../types";
|
import { Cell } from "../types";
|
||||||
import Board from "./board";
|
import Board from "./board";
|
||||||
|
|
||||||
|
const DEFAULT_CLICKED_CELL = -1;
|
||||||
|
|
||||||
interface GameProps {
|
interface GameProps {
|
||||||
gameId: number;
|
gameId: number;
|
||||||
|
playerId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Game = (props: GameProps) => {
|
const Game = (props: GameProps) => {
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
const [cellWidth, setCellWidth] = useState(4);
|
const [cellWidth, setCellWidth] = useState(0);
|
||||||
const [cells, setCells] = useState([] as Cell[]);
|
const [cells, setCells] = useState([] as Cell[]);
|
||||||
|
const [focusedCellIndex, setFocusedCellIndex] =
|
||||||
|
useState(DEFAULT_CLICKED_CELL);
|
||||||
|
|
||||||
|
const onCellClicked = (cellIndex: number): void => {
|
||||||
|
if (cellIndex === focusedCellIndex) {
|
||||||
|
setFocusedCellIndex(DEFAULT_CLICKED_CELL);
|
||||||
|
return;
|
||||||
|
} else if (focusedCellIndex === DEFAULT_CLICKED_CELL) {
|
||||||
|
setFocusedCellIndex(cellIndex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
submitMove(
|
||||||
|
props.playerId,
|
||||||
|
props.gameId,
|
||||||
|
convertIndexToPosition(focusedCellIndex, cellWidth),
|
||||||
|
convertIndexToPosition(cellIndex, cellWidth)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
fetchGameState("red", props.gameId).then(
|
fetchGameState(props.playerId, props.gameId).then(
|
||||||
({ cells: cellList, cellWidth: width }) => {
|
({ cells: cellList, cellWidth: width }) => {
|
||||||
setCellWidth(width);
|
setCellWidth(width);
|
||||||
setCells(cellList);
|
setCells(cellList);
|
||||||
@ -22,7 +45,14 @@ const Game = (props: GameProps) => {
|
|||||||
);
|
);
|
||||||
}, [props.gameId]);
|
}, [props.gameId]);
|
||||||
|
|
||||||
return <Board cellWidth={cellWidth} cells={cells} />;
|
return (
|
||||||
|
<Board
|
||||||
|
cellWidth={cellWidth}
|
||||||
|
cells={cells}
|
||||||
|
focusedCellIndex={focusedCellIndex}
|
||||||
|
onCellClick={onCellClicked}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Game;
|
export default Game;
|
||||||
|
11
ui/package-lock.json
generated
11
ui/package-lock.json
generated
@ -8,6 +8,7 @@
|
|||||||
"name": "ui",
|
"name": "ui",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"classnames": "^2.3.1",
|
||||||
"next": "12.1.0",
|
"next": "12.1.0",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
@ -528,6 +529,11 @@
|
|||||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/classnames": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA=="
|
||||||
|
},
|
||||||
"node_modules/color-convert": {
|
"node_modules/color-convert": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
@ -2842,6 +2848,11 @@
|
|||||||
"supports-color": "^7.1.0"
|
"supports-color": "^7.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"classnames": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA=="
|
||||||
|
},
|
||||||
"color-convert": {
|
"color-convert": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"classnames": "^2.3.1",
|
||||||
"next": "12.1.0",
|
"next": "12.1.0",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
|
@ -11,7 +11,7 @@ const Home: NextPage = () => (
|
|||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
</Head>
|
</Head>
|
||||||
<main>
|
<main>
|
||||||
<Game gameId={1} />
|
<Game gameId={1} playerId="red" />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -5,4 +5,9 @@
|
|||||||
.gridCell {
|
.gridCell {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
padding-top: 100%; /* 100% is supposed to be 1:1 aspect ratio but it doesn't look like it */
|
padding-top: 100%; /* 100% is supposed to be 1:1 aspect ratio but it doesn't look like it */
|
||||||
|
background: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cellClicked {
|
||||||
|
border: 1px solid red;
|
||||||
}
|
}
|
@ -3,4 +3,9 @@ export interface Cell {
|
|||||||
terrain: boolean;
|
terrain: boolean;
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
empty: boolean;
|
empty: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Position {
|
||||||
|
row: number;
|
||||||
|
column: number;
|
||||||
}
|
}
|
9
ui/utils/position.ts
Normal file
9
ui/utils/position.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { Position } from "../types";
|
||||||
|
|
||||||
|
export const convertIndexToPosition = (
|
||||||
|
index: number,
|
||||||
|
cellWidth: number
|
||||||
|
): Position => ({
|
||||||
|
row: Math.floor(index / cellWidth),
|
||||||
|
column: index % cellWidth,
|
||||||
|
});
|
10
util.go
10
util.go
@ -21,16 +21,6 @@ func respondWithJSON(res http.ResponseWriter, code int, payload interface{}) {
|
|||||||
res.Write(response)
|
res.Write(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
func rotateBoard(board [][]*ViewTile) {
|
|
||||||
i := 0
|
|
||||||
temp := board[0]
|
|
||||||
for ; i < len(board)-1; i++ {
|
|
||||||
board[i] = board[i+1]
|
|
||||||
}
|
|
||||||
|
|
||||||
board[i] = temp
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO remove this when you can actually setup a game
|
//TODO remove this when you can actually setup a game
|
||||||
func initDummy(g *freego.Game) {
|
func initDummy(g *freego.Game) {
|
||||||
//Setup terrain
|
//Setup terrain
|
||||||
|
13
view_tile.go
13
view_tile.go
@ -12,16 +12,3 @@ type ViewTile struct {
|
|||||||
func NewViewTile() *ViewTile {
|
func NewViewTile() *ViewTile {
|
||||||
return &ViewTile{}
|
return &ViewTile{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vt *ViewTile) String() string {
|
|
||||||
if vt.Piece != "" {
|
|
||||||
return vt.Piece
|
|
||||||
}
|
|
||||||
if vt.Hidden {
|
|
||||||
return "?"
|
|
||||||
}
|
|
||||||
if vt.Terrain {
|
|
||||||
return "X"
|
|
||||||
}
|
|
||||||
return " "
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user