fix: boop supply
This commit is contained in:
parent
8bd790db67
commit
ecfa89e383
|
|
@ -88,10 +88,10 @@ export class PieceTypeSelector {
|
||||||
|
|
||||||
update(state: BoopState): void {
|
update(state: BoopState): void {
|
||||||
const currentPlayer = state.currentPlayer;
|
const currentPlayer = state.currentPlayer;
|
||||||
const { kittensInSupply, catsInSupply, catsOnBoard } = this.countPieces(state, currentPlayer);
|
const { kittensInSupply, catsInSupply } = this.countPieces(state, currentPlayer);
|
||||||
|
|
||||||
const kittenAvailable = kittensInSupply > 0;
|
const kittenAvailable = kittensInSupply > 0;
|
||||||
const catsAvailable = catsInSupply + catsOnBoard > 0;
|
const catsAvailable = catsInSupply > 0;
|
||||||
|
|
||||||
this.updateButton(
|
this.updateButton(
|
||||||
this.kittenButton,
|
this.kittenButton,
|
||||||
|
|
@ -104,7 +104,7 @@ export class PieceTypeSelector {
|
||||||
this.catButton,
|
this.catButton,
|
||||||
catsAvailable,
|
catsAvailable,
|
||||||
this.selectedType === 'cat',
|
this.selectedType === 'cat',
|
||||||
`🐱 大猫 (${catsInSupply + catsOnBoard})`
|
`🐱 大猫 (${catsInSupply})`
|
||||||
);
|
);
|
||||||
|
|
||||||
// 自动切换到可用类型
|
// 自动切换到可用类型
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue