Guest User

Untitled

a guest
Jun 25th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace AIYou
  7. {
  8.     static class TextManager
  9.     {
  10.         //Class used for wordwrap and anything the text may need to do, all text gets pushed through here before being printed out on the screen.
  11.  
  12.         //Set this variable to whatever data needs to be displayed.
  13.         private static string outputBuffer;
  14.  
  15.         public static string action;
  16.  
  17.         public static void Add(string line)
  18.         {
  19.             //Anything that needs to be done first will be put around this, currently we just want the text to be added to the outputBuffer variable.
  20.             outputBuffer += line + "\n";
  21.         }
  22.  
  23.         public static void Display()
  24.         {
  25.            
  26.  
  27.             //Clear the screen each time this is written out.
  28.             Console.Clear();
  29.  
  30.             if (action != null)
  31.                 Console.WriteLine(action);
  32.  
  33.             //Writes out any data sent to the outputBuffer variable to screen.
  34.             Console.WriteLine(outputBuffer);
  35.  
  36.             Console.Write(">ACTION: ");
  37.             action = Convert.ToString(Console.Read());
  38.  
  39.             outputBuffer = "";
  40.         }
  41.     }
  42. }
Add Comment
Please, Sign In to add comment