From 2e6a4a8761bf037283f7eb8dbfd57ab7b9e977a9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 12 Mar 2022 15:10:54 +0300 Subject: refactor: rename Cell -> Tile, Item -> Feature --- src/Board/Board.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Board/Board.ts') diff --git a/src/Board/Board.ts b/src/Board/Board.ts index c511e89..f1aa45b 100644 --- a/src/Board/Board.ts +++ b/src/Board/Board.ts @@ -1,25 +1,25 @@ import _ from 'lodash'; -import Cell, { Item } from "../Cell/Cell"; +import Tile, { Feature } from "../Tile/Tile"; -const { Road, Town, Empty } = Item; +const { Road, Town, Empty } = Feature; export default class Board { - cells: Cell[]; + cells: Tile[]; - constructor(cells?: Cell[]) { + constructor(cells?: Tile[]) { if (cells) this.cells = cells; - else this.cells = [new Cell(Road, [Town, Road, Empty, Road])] + else this.cells = [new Tile(Road, [Town, Road, Empty, Road])] } print() { this.cells.forEach(cell => cell.print()); } - getAttachments(cell: Cell) { + getAttachments(cell: Tile) { return _.flatten(this.cells.map(attachTo => attachTo.getAttachments(cell))); } - getLegalMoves(cell: Cell) { + getLegalMoves(cell: Tile) { const attachments = this.getAttachments(cell); console.log(attachments); } -- cgit v1.2.3