Refacto pour test ppcGame

This commit is contained in:
Grizouille
2025-12-12 16:30:45 +01:00
parent 7cec5696dc
commit 2bbd8a35df
4 changed files with 55 additions and 38 deletions

View File

@@ -1,10 +1,22 @@
using MiniJeuxFinal.Games.PierrePapierCiseaux;
using MiniJeuxFinal.Games;
using MiniJeuxFinal.Games.PierrePapierCiseaux;
using MiniJeuxFinal.Games.PierrePapierCiseaux.Actions;
using MiniJeuxFinal.Games.PierrePapierCiseaux.Factories;
using MiniJeuxFinal.Games.PierrePapierCiseaux.Players;
using MiniJeuxFinal.Wrappers;
class Program()
{
public static void Main()
{
var game = new PierrePapierCiseauxGame(3, "loic");
Console.WriteLine("Entrer votre nom de joueur:");
var userName = Console.ReadLine();
var player = new PlayerPpc(userName, new InputActionFactory(new ConsoleService()));
var computer = new PlayerPpc("Ordi", new RandomActionFactory());
IAction[] lstActions = [new StoneAction(), new PaperAction(), new ScissorsAction()];
player.AddAction(lstActions);
computer.AddAction(lstActions);
var game = new PierrePapierCiseauxGame(3, player, computer);
game.TurnStarted += (sender, tuple) =>
{
Console.WriteLine($"Tu joues : {tuple.playerChoice}");