/// <summary> /// /// </summary> /// <returns></returns> public void PlayRound() { // Get Player's Move Move playerMove = player.GetMove(); // Get Computer's Move Move computerMove = computer.GetMove(); // Generate Result RoundResult result = new RoundResult(playerMove, computerMove); _outputter.Write($"{result.PlayerMove} vs. {result.ComputerMove}!"); if (result.Result == Result.Win) { _outputter.Write($"{player.Name} has won this round!"); } else if (result.Result == Result.Lose) { _outputter.Write($"{computer.Name} has won this round!"); } else if (result.Result == Result.Draw) { _outputter.Write($"{player.Name} and {computer.Name} have met in a draw this round!"); } else { throw(new SystemException("Round result invalid?!")); } // Save Result history.Add(result); _outputter.Write(); }
public void ShowResult() { _outputter.WriteLine(PreparedStrings.ResultBegin); Values.ForEach(v => _outputter.Write($"{v} ")); _outputter.WriteLine(Empty); _outputter.WriteLine(Format(PreparedStrings.MinValueOutput, Values.Min(), Values.IndexOf(Values.Min()))); _outputter.WriteLine(Format(PreparedStrings.MaxValueOutput, Values.Max(), Values.IndexOf(Values.Max()))); }
public void PrintLine(string input) { _outputter.Write(input); }
public Parser(string fileLocation, IOutputter outputter) : this(outputter) { _outputter.Write($"Loading character pool from {fileLocation}... "); _rawBytes = File.ReadAllBytes(fileLocation); _outputter.WriteLine("Success!"); }
public void PromptForInput() { _outputter.Write(InputMessage); }