This commit is contained in:
Halit Aksoy 2022-05-02 00:41:01 +03:00
parent 31e56d5a04
commit a65ed8fe16

29
src/core/Pit.ts Normal file
View File

@ -0,0 +1,29 @@
export class Pit {
stoneCount: number;
constructor(stoneCount = 0) {
this.stoneCount = stoneCount;
}
get isBank(): boolean {
return false;
}
public increaseStone(count = 1) {
this.stoneCount += count;
}
public decreaseStone(count = 1) {
this.stoneCount -= count;
}
}
export class Bank extends Pit {
constructor(stoneCount = 0) {
super(stoneCount);
}
override get isBank(): boolean {
return true;
}
}