diff options
Diffstat (limited to 'src/Board/Board.ts')
-rw-r--r-- | src/Board/Board.ts | 14 |
1 files changed, 7 insertions, 7 deletions
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); } |