add pit
This commit is contained in:
parent
31e56d5a04
commit
a65ed8fe16
29
src/core/Pit.ts
Normal file
29
src/core/Pit.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user