pokerogue/src/battle.ts
2023-03-30 23:02:35 -04:00

21 lines
672 B
TypeScript

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);
}
}