public void play() { int choix = 0; while (!isEnd()) { parleAll(listInLife); Utilisateur.afficheEcran("Qui voulez-vous nourrir?"); choix = PlayerChoice(); Tamagoshis tam = (Tamagoshis)listInLife[choix]; tam.mange(); consommeEnergieAll(listInLife); this.nbTour--; } this.End(); }
private void Addlist(String name) { int num = rand.Next(3); Tamagoshis tam; if (num < 2) { tam = new Tamagoshis(name); } else { if (num == 2) { tam = new GrosJoueur(name); } else { tam = new GrosMangeur(name); } } listDepart.Add(tam); listInLife.Add(tam); }