fix: boop supply

This commit is contained in:
hyper 2026-04-12 18:55:35 +08:00
parent 8bd790db67
commit ecfa89e383
1 changed files with 4 additions and 4 deletions

View File

@ -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})`
); );
// 自动切换到可用类型 // 自动切换到可用类型