From 26b15f6ef72ca983e5fb114fb36bf0c0860a91ea Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 12 Mar 2022 15:34:27 +0300 Subject: refactor: re-use parent class method --- src/Tile/TileOnBoard.ts | 4 ++-- 1 file 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) { -- cgit v1.2.3