add checkPitTypeIsNormalPitByIndex and checkPitTypeIsBankByIndex

This commit is contained in:
Halit Aksoy 2022-05-08 16:58:56 +03:00
parent fc254d069e
commit ebd2fef54c

View File

@ -83,6 +83,18 @@ export class Board {
}
}
public checkPitTypeIsNormalPitByIndex(index: number): boolean {
this.checkIndeAndMaybeThrowError(index);
const pitType = this.getPitTypeByIndex(index);
return pitType === 'player1Pit' || pitType === 'player2Pit';
}
public checkPitTypeIsBankByIndex(index: number): boolean {
this.checkIndeAndMaybeThrowError(index);
const pitType = this.getPitTypeByIndex(index);
return pitType === 'player1Bank' || pitType === 'player2Bank';
}
public move(index: number) {
this.checkIndeAndMaybeThrowError(index);
const pitType = this.getPitTypeByIndex(index);