public static void Display() { Console.Clear(); Console.Write(TextUtilils.WordWrap(outputBuffer, Console.WindowWidth)); //no new line Console.WriteLine("What shall I do?"); //newline Console.Write(">"); outputBuffer = ""; }
public static void EndGame(string endingText) { Program.Quit = true; Console.Clear(); Console.WriteLine(TextUtilils.WordWrap(endingText, Console.WindowWidth)); Console.WriteLine("\nYou Can Now close This Window..."); Console.CursorVisible = false; while (true) { Console.ReadKey(true); } }
//Public Methods public static void ShowTitleScreen() { Console.Clear(); Console.WriteLine(); Console.WriteLine(TextUtilils.WordWrap("*** Welcome to HighPerion! ***" + "\n\n\n", Console.WindowWidth)); //Console.WriteLine(TextUtilils.WordWrap("*** Welcome to HighPerion! ***"+ "\n\n\n",Console.WindowWidth)); Console.WriteLine("\nNote: You can type 'help' at any time to see a list of commands"); Console.WriteLine("\nPress a key to begin..."); Console.CursorVisible = false; Console.ReadKey(); Console.CursorVisible = true; Console.Clear(); }
public static void ProcessCommand(string line) { string command = TextUtilils.ExtractCommand(line.Trim()).Trim().ToLower(); string arguments = TextUtilils.ExtractArgueMent(line.Trim()).ToLower(); switch (command) { case "exit": Program.Quit = true; return; case "help": ShowHelp(); break; case "move": Player.Move(arguments); break; case "look": Player.GetCurrentRoom().Describe(); break; case "pickup": Player.PickUpItem(arguments); break; case "drop": Player.DropItem(arguments); break; case "inventory": Player.DisplayInventory(); break; case "whereami": Player.GetCurrentRoom().ShowTitle(); break; default: TextBuffer.Add("Not a Valid Command"); break; } GameManager.ApplyRules(); TextBuffer.Display(); }