BadScript 2
Loading...
Searching...
No Matches
BadConsole.cs
Go to the documentation of this file.
1using System;
2using System.Threading.Tasks;
3
5
7
11public static class BadConsole
12{
16 private static IBadConsole s_Console;
17
21 static BadConsole()
22 {
24 }
25
26
30 public static ConsoleColor ForegroundColor
31 {
33 set => s_Console.ForegroundColor = value;
34 }
35
39 public static ConsoleColor BackgroundColor
40 {
42 set => s_Console.BackgroundColor = value;
43 }
44
49 public static IBadConsole GetConsole()
50 {
51 return s_Console;
52 }
53
58 public static void SetConsole(IBadConsole console)
59 {
60 s_Console = console;
61 }
62
67 public static void Write(string str)
68 {
69 s_Console.Write(str);
70 }
71
76 public static void WriteLine(string str)
77 {
79 }
80
85 public static string ReadLine()
86 {
87 return s_Console.ReadLine();
88 }
89
94 public static Task<string> ReadLineAsync()
95 {
96 return s_Console.ReadLineAsync();
97 }
98
102 public static void Clear()
103 {
105 }
106}
Wrapper class for the console abstraction.
Definition BadConsole.cs:12
static Task< string > ReadLineAsync()
Reads a line from the console asynchronously.
Definition BadConsole.cs:94
static void Clear()
Clears the console.
static string ReadLine()
Reads a line from the console.
Definition BadConsole.cs:85
static ConsoleColor BackgroundColor
The Background Color.
Definition BadConsole.cs:40
static IBadConsole s_Console
The Console Implementation that is used.
Definition BadConsole.cs:16
static void Write(string str)
Writes a string to the console.
Definition BadConsole.cs:67
static void WriteLine(string str)
Writes a string to the console and appends a newline.
Definition BadConsole.cs:76
static IBadConsole GetConsole()
Returns the Current Console Implementation.
Definition BadConsole.cs:49
static BadConsole()
Static Constructor.
Definition BadConsole.cs:21
static ConsoleColor ForegroundColor
The Foreground Color.
Definition BadConsole.cs:31
static void SetConsole(IBadConsole console)
Sets the Current Console Implementation.
Definition BadConsole.cs:58
Implements a wrapper for the default system console.
Interface that abstracts the console.
void WriteLine(string str)
Writes a string to the console and appends a newline.
string ReadLine()
Reads a line from the console.
void Write(string str)
Writes a string to the console.
ConsoleColor ForegroundColor
The Foreground Color.
ConsoleColor BackgroundColor
The Background Color.
Task< string > ReadLineAsync()
Reads a line from the console asynchronously.
Contains Implementation of the Console Abstractions.
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Definition BadConsole.cs:6