using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Programmation_objet_TLESIO21.projet { public class Player { private String Nom; private List Team; private int currentPokemonIndex; public Player(string nom) { this.Nom = nom; this.Team = new List(); } public void choosePokemon(Pokemon pkm) { this.Team.Add(pkm); } public String getNom() { return this.Nom; } public List getTeam() { return this.Team; } public void setCurrentPokemonIndex(int i) { this.currentPokemonIndex = i; } public Pokemon getCurrentPokemon() { return this.getTeam()[currentPokemonIndex]; } public bool canStillFight() { int pkmCount = this.Team.Count; foreach(Pokemon pkm in Team) { if(!pkm.isAlive()) { pkmCount--; } } return pkmCount == 0; } public override string ToString() { String sb = ""; sb += this.Nom + " a pour pokémons : "; foreach (Pokemon p in this.Team) { sb += p.getName() + ". "; } return sb; } } }