diff options
Diffstat (limited to 'src/Tile/TileOnBoard.ts')
-rw-r--r-- | src/Tile/TileOnBoard.ts | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/Tile/TileOnBoard.ts b/src/Tile/TileOnBoard.ts index 374ae95..bc1e66d 100644 --- a/src/Tile/TileOnBoard.ts +++ b/src/Tile/TileOnBoard.ts @@ -2,14 +2,13 @@ import _ from 'lodash'; import Tile, { Feature, Direction } from './Tile'; export interface Attachment { - attachTo: Tile; + attachTo: TileOnBoard; side: Direction; tile: Tile; - rotation: number; // Clockwise rotation of a tile + orientation: number; // Clockwise rotation of a tile } export default class TileOnBoard extends Tile { - neighbors: [Tile, Tile, Tile, Tile]; orientation: number; // amount of 90-degree counter-clockwise rotations from original orientation position: { x: number; @@ -26,7 +25,6 @@ export default class TileOnBoard extends Tile { super(center, sides, shield); this.position = position; this.orientation = orientation; - this.neighbors = [null, null, null, null]; } getSide(direction: Direction) { @@ -52,9 +50,4 @@ export default class TileOnBoard extends Tile { })) })); } - - attach(tile: Tile, side: Direction) { - if (this.neighbors[side]) throw new Error('There is something already attached to this side!'); - this.neighbors[side] = tile; - } } |