pokerogue/src/battle.ts

21 lines
672 B
TypeScript
Raw Normal View History

2023-03-30 20:02:35 -07:00
import { EnemyPokemon, PlayerPokemon } from "./pokemon";
export class Battle {
public waveIndex: integer;
public enemyPokemon: EnemyPokemon;
public playerParticipantIds: Set<integer> = new Set<integer>();
constructor(waveIndex: integer, enemyPokemon: EnemyPokemon) {
this.waveIndex = waveIndex;
this.enemyPokemon = enemyPokemon;
}
addParticipant(playerPokemon: PlayerPokemon) {
console.log('add participant', playerPokemon.name)
this.playerParticipantIds.add(playerPokemon.id);
}
removeFaintedParticipant(playerPokemon: PlayerPokemon) {
this.playerParticipantIds.delete(playerPokemon.id);
}
}