public static int ReadPlayfieldSize() { ConsoleMessagePrinter.PrintLine("You can choose from the following playfield sizes: "); ConsoleMessagePrinter.PrintLine("1 - Small"); ConsoleMessagePrinter.PrintLine("2 - Medium"); ConsoleMessagePrinter.PrintLine("3 - Large"); ConsoleMessagePrinter.PrintLine("Enter number: "); string input = Console.ReadLine(); int size; bool isInputCorrect = int.TryParse(input, out size); while (!isInputCorrect) { ConsoleMessagePrinter.PrintLine("Wrong input. Enter again: "); input = Console.ReadLine(); isInputCorrect = int.TryParse(input, out size); } return(size); }
public static void PrintWinMessage(int userMoves) { string message = string.Format(ConsoleMessagePrinter.WinMessageFormat, userMoves); ConsoleMessagePrinter.PrintLine(message); }
public static void PrintInvalidMove() { ConsoleMessagePrinter.PrintLine(ConsoleMessagePrinter.InvalidMoveMessage); }
public static void PrintInvalidInput() { ConsoleMessagePrinter.PrintLine(ConsoleMessagePrinter.InvalidCommandMessage); }
public static void PrintWelcomeMessage() { ConsoleMessagePrinter.PrintLine(ConsoleMessagePrinter.WelcomeMessage); }
public static void PrintExitMessage(int userMoves, int balloonsLeft) { ConsoleMessagePrinter.PrintLine(ConsoleMessagePrinter.ByeMessage); ConsoleMessagePrinter.PrintLine(userMoves.ToString()); ConsoleMessagePrinter.PrintLine(balloonsLeft.ToString()); }