private int SimulateGamesAndGetSmartPlayerWins(int gamesToSimulate) { var smartPlayer = new SmartPlayer(); var smartPlayerWins = 0; var dummyPlayer = new DummyPlayer(); var game = new SantaseGame(smartPlayer, dummyPlayer); for (var i = 0; i < gamesToSimulate; i++) { var winner = game.Start(i % 2 == 0 ? PlayerPosition.FirstPlayer : PlayerPosition.SecondPlayer); if (winner == PlayerPosition.FirstPlayer) { smartPlayerWins++; } } // Console.WriteLine(smartPlayerWins); return smartPlayerWins; }
protected override ISantaseGame CreateGame() { IPlayer firstPlayer = new DummyPlayer("First Dummy Player"); IPlayer secondPlayer = new DummyPlayer("Second Dummy Player"); ISantaseGame game = new SantaseGame(firstPlayer, secondPlayer); // new ConsoleLogger("[game] ")); return game; }