diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-03-12 15:47:58 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-03-12 15:47:58 +0300 |
commit | 668985e6ed78add10e3a0eb94eff283d59b3971f (patch) | |
tree | f3a379f4fba55817460f6bed00ba17dee0ffeff1 /src/Tile/TileOnBoard.ts | |
parent | 26b15f6ef72ca983e5fb114fb36bf0c0860a91ea (diff) | |
download | carcassonne-engine-ts-668985e6ed78add10e3a0eb94eff283d59b3971f.tar.gz |
refactor: rename Feature.Emtpy -> Grass
Diffstat (limited to 'src/Tile/TileOnBoard.ts')
-rw-r--r-- | src/Tile/TileOnBoard.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Tile/TileOnBoard.ts b/src/Tile/TileOnBoard.ts index b15fcf4..fb0817c 100644 --- a/src/Tile/TileOnBoard.ts +++ b/src/Tile/TileOnBoard.ts @@ -10,7 +10,11 @@ export interface Attachment { export default class TileOnBoard extends Tile { neighbors: [Tile, Tile, Tile, Tile]; - orientation: number // amount of 90-degree counter-clockwise rotations from original orientation + orientation: number; // amount of 90-degree counter-clockwise rotations from original orientation + position: { + x: number; + y: number; + } constructor(center: Feature, sides: [Feature, Feature, Feature, Feature], shield = false, orientation = 0) { super(center, sides, shield); @@ -22,6 +26,8 @@ export default class TileOnBoard extends Tile { } rotate(rotation = 1) { + // We want to rotate clockwise, but orientation stores counter-clockwise rotations, + // therefore use the difference, not sum. this.orientation = this.orientation - rotation; } |