public override void NewRoundStarted(GameMap gameState) { ConsoleRender.RenderToConsolePretty(gameState, BattleshipPlayer.PlayerType); if (gameState.Phase == 1) { try { FirstRoundCommand(); } catch (Exception exception) { Console.WriteLine(exception); Console.WriteLine("Please try again"); Console.WriteLine(); FirstRoundCommand(); } } else { try { GeneralCommands(); } catch (Exception exception) { Console.WriteLine(exception); Console.WriteLine("Please try again"); Console.WriteLine(); GeneralCommands(); } } }
public override void NewRoundStarted(GameMap gameState) { ConsoleRender.RenderToConsolePretty(gameState, playerKey); Console.WriteLine("To move, type a,w,s,d and press enter"); Console.WriteLine("To plant a bomb, type z and enter"); Console.WriteLine("You can reduce the bomb timer to 1 using x"); Console.WriteLine(); Console.WriteLine("Movement for player " + Name); var line = System.Console.ReadLine(); if (line == "w") { PublishCommand(new MovementCommand(MovementCommand.Direction.Up)); } else if (line == "s") { PublishCommand(new MovementCommand(MovementCommand.Direction.Down)); } else if (line == "a") { PublishCommand(new MovementCommand(MovementCommand.Direction.Left)); } else if (line == "d") { PublishCommand(new MovementCommand(MovementCommand.Direction.Right)); } else if (line == "z") { PublishCommand(new PlaceBombCommand()); } else if (line == "x") { PublishCommand(new TriggerBombCommand()); } else { PublishCommand(new DoNothingCommand()); } }
void engine_RoundComplete(GameMap gameMap, int round) { ConsoleRender.RenderToConsolePretty(gameMap, 'Z'); }
private void EngineOnGameStarted(GameMap gameMap) { ConsoleRender.RenderToConsolePretty(gameMap, 'Z'); }