diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-03-12 15:34:27 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-03-12 15:34:39 +0300 |
commit | 26b15f6ef72ca983e5fb114fb36bf0c0860a91ea (patch) | |
tree | 4d7503940dbb34be2e8d11bcaa1fb0732b3c735f | |
parent | 77b2f09883d4144c01802c5c75622e28f3864ca0 (diff) | |
download | carcassonne-engine-ts-26b15f6ef72ca983e5fb114fb36bf0c0860a91ea.tar.gz |
refactor: re-use parent class method
-rw-r--r-- | src/Tile/TileOnBoard.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Tile/TileOnBoard.ts b/src/Tile/TileOnBoard.ts index 65f3731..b15fcf4 100644 --- a/src/Tile/TileOnBoard.ts +++ b/src/Tile/TileOnBoard.ts @@ -10,7 +10,7 @@ export interface Attachment { export default class TileOnBoard extends Tile { neighbors: [Tile, Tile, Tile, Tile]; - private orientation: number // amount of 90-degree counter-clockwise rotations from original orientation + orientation: number // amount of 90-degree counter-clockwise rotations from original orientation constructor(center: Feature, sides: [Feature, Feature, Feature, Feature], shield = false, orientation = 0) { super(center, sides, shield); @@ -18,7 +18,7 @@ export default class TileOnBoard extends Tile { } getSide(direction: Direction) { - return this.sides[(((this.orientation + direction) % 4) + 4) % 4]; + return super.getSide(direction + this.orientation); } rotate(rotation = 1) { |