static public Joueur GestionPouvoirs(Joueur j, Carte c) { switch (c.Libelle) { case "BRUTUS": j.Deck = CarteHelper.DefausserCartes(j.Deck, 3); break; case "LE MINOT": j.Hand = CarteHelper.DefausserCartes(j.Hand, 2); j.Deck.Add(CarteHelper.PiocherCarte(j)); break; case "HORN": j.Hand = CarteHelper.DefausserCartes(j.Hand, 2); j.Deck = CarteHelper.DefausserCartes(j.Deck, 1); break; case "LES JUMEAUX": j.CouleurInterdite = DemanderFamilleInterdite(); break; } return(j); }
public static Carte DemanderCarte(Joueur j) { Console.WriteLine("Quelle carte jouer ? (valeur de carte)"); string cardPlayer1 = Console.ReadLine(); Carte c = CarteHelper.ObtenirCarte(j.Hand, int.Parse(cardPlayer1)); return(c); }
static public Partie TourDeJeu(Partie partie) { //Calcul des cartes autorisées CarteHelper.MajCartesAutorisees(partie); //Tour du premier joueur TourJoueur(partie.Joueur1); //Tour du deuxième joueur TourJoueur(partie.Joueur2); //Gestion du duel return(partie); }
static public Carte TourJoueur(Joueur j) { Carte carteJouee = null; AffichageHelper.AfficherListeCartes(j.Hand); while (carteJouee == null) { Console.WriteLine("Quelle carte jouer ? (valeur de carte)"); Carte c = CarteHelper.ObtenirCarte(j.Hand, int.Parse(Console.ReadLine())); //Vérification de la validité de la carte du joueur if (j.CartesAutorisees.Contains(c)) { carteJouee = c; } else { Console.WriteLine("Vous n'avez pas le droit de jouer cette carte.\n"); } } return(carteJouee); }