From 668985e6ed78add10e3a0eb94eff283d59b3971f Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 12 Mar 2022 15:47:58 +0300 Subject: refactor: rename Feature.Emtpy -> Grass --- src/Board/Board.test.ts | 6 +++--- src/Board/Board.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Board') diff --git a/src/Board/Board.test.ts b/src/Board/Board.test.ts index 1370a87..7e99581 100644 --- a/src/Board/Board.test.ts +++ b/src/Board/Board.test.ts @@ -3,14 +3,14 @@ import Tile, { Feature } from '../Tile/Tile'; import TileOnBoard from '../Tile/TileOnBoard'; import Board from './Board'; -const { Road, Town, Empty } = Feature; +const { Road, Town, Grass } = Feature; describe('Board', () => { describe('constructor', () => { it('Should initialize empty board with a starting tile', () => { const board = new Board(); assert.strictEqual(board.tiles.length, 1); - assert.deepStrictEqual(board.tiles[0], new TileOnBoard(Road, [Town, Road, Empty, Road])); + assert.deepStrictEqual(board.tiles[0], new TileOnBoard(Road, [Town, Road, Grass, Road])); }); }); @@ -18,7 +18,7 @@ describe('Board', () => { it('Should correctly determine legal moves for 1-tile board', () => { const board = new Board(); const attachTo = board.tiles[0]; - const tile = new Tile(Town, [Empty, Town, Empty, Town]); + const tile = new Tile(Town, [Grass, Town, Grass, Town]); const legalMoves = board.getAttachments(tile); assert.strictEqual(legalMoves.length, 4); diff --git a/src/Board/Board.ts b/src/Board/Board.ts index 59afd31..2c4a215 100644 --- a/src/Board/Board.ts +++ b/src/Board/Board.ts @@ -2,14 +2,14 @@ import _ from 'lodash'; import Tile, { Feature } from '../Tile/Tile'; import TileOnBoard from '../Tile/TileOnBoard'; -const { Road, Town, Empty } = Feature; +const { Road, Town, Grass } = Feature; export default class Board { tiles: TileOnBoard[]; constructor(tiles?: TileOnBoard[]) { if (tiles) this.tiles = tiles; - else this.tiles = [new TileOnBoard(Road, [Town, Road, Empty, Road])] + else this.tiles = [new TileOnBoard(Road, [Town, Road, Grass, Road])] } print() { -- cgit v1.2.3