Refacto pour test ppcGame
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user