static void Main() { var game = new Game(new HexValuesGenerator(NUMBER_OF_COLORS), new SimplestPlayer()); var renderer = new ConsoleBwRenderer(game); //CheckAllGeneratedTriplets(renderer, game.Board); LetsPlay(renderer, game); Console.ReadKey(true); }
private static void LetsPlay(IRenderer _renderer, Game _game) { _renderer.Render(); var turnMode = true; foreach (var gamePhase in _game.Turns()) { switch (gamePhase) { case Game.EGamePhase.BOARD_PREPARE: continue; case Game.EGamePhase.JUST_REDRAW: _renderer.Render(); break; case Game.EGamePhase.TURN_DONE: _renderer.Render(); break; default: throw new ArgumentOutOfRangeException(); } } Console.WriteLine(_game.Player + " gives up."); }
public ConsoleBwRenderer(Game _game) { m_game = _game; Console.SetWindowSize(50,50); Console.SetBufferSize(50, 50); }