public void Play() { var playerTurn = _setup.Player1GoesFirst; bool playOn = true; while (playOn) { ShotStatus status = new ShotStatus(); Console.Clear(); if (playerTurn) { status = FireShotPrompt(_setup.Player2Board, _setup.Player1Name); } else { status = FireShotPrompt(_setup.Player1Board, _setup.Player2Name); } if (status == ShotStatus.Invalid || status == ShotStatus.Duplicate) { playerTurn = !playerTurn; } playerTurn = !playerTurn; if (status != ShotStatus.Victory) { playOn = true; } else { playOn = false; Console.WriteLine("Press ENTER to play again or press Q to quit."); if (Console.ReadKey().Key == ConsoleKey.Q) { return; } else { SetupWorkflow restart = new SetupWorkflow(); restart.Start(); } } } }
internal void StartBattleship() { _setup.Start(); Play(); }
static void Main(string[] args) { SetupWorkflow tempSetup = new SetupWorkflow(); tempSetup.Start(); }