private void GetTargetColumnFromUser(GameManager gameLogic) { string userInput; if (gameLogic.CurrntPlayer.IsComputer) { userInput=gameLogic.GetComputerChoice().ToString(); while (!gameLogic.SetTargetColumn(userInput)&&gameLogic.CanMoveBeMade()) { userInput = gameLogic.GetComputerChoice().ToString(); } } else { userInput = Console.ReadLine(); while (!gameLogic.SetTargetColumn(userInput) && gameLogic.CanMoveBeMade()) { Console.Clear(); DrawBoard(gameLogic); Console.WriteLine("you have entered an invalid column please enter a column to move to"); Console.WriteLine("you chose column number " + originColumn); Console.Write("your dice results are"); foreach (var diceResult in gameLogic.DiceResults) { Console.Write(" " + diceResult); } Console.WriteLine(); Console.WriteLine("Please choose again"); userInput = Console.ReadLine(); } DrawBoard(gameLogic); Console.WriteLine("you moved to column" + userInput); } }
private void GetOriginColumnFromUser(GameManager gameLogic) { if (gameLogic.CurrntPlayer.IsComputer) { originColumn = gameLogic.GetComputerChoice().ToString(); if (gameLogic.CanMoveBeMade()) { while (!gameLogic.SetOriginColumn(originColumn) && gameLogic.CanMoveBeMade()) { originColumn = gameLogic.GetComputerChoice().ToString(); } } } else { originColumn = Console.ReadLine(); while (!gameLogic.SetOriginColumn(originColumn) && gameLogic.CanMoveBeMade()) { Console.Clear(); DrawBoard(gameLogic); Console.WriteLine("you have entered an invalid column please Choose a column to move from"); originColumn = Console.ReadLine(); } Console.WriteLine("you chose to move form column" + originColumn); } }