Changed a lot of Actions.cs and a few other things to be more easily

extendable.
This commit is contained in:
2025-09-03 23:32:20 -05:00
parent 69e6699e26
commit e4b230a0ad
21 changed files with 834 additions and 314 deletions

36
ColoredConsole.cs Normal file
View File

@@ -0,0 +1,36 @@
public static class ColoredConsole
{
public static void WriteLine(string text, ConsoleColor color)
{
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = color;
Console.WriteLine(text);
Console.ForegroundColor = previousColor;
}
public static void Write(string text, ConsoleColor color)
{
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = color;
Console.Write(text);
Console.ForegroundColor = previousColor;
}
public static string Prompt(string text)
{
try
{
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green;
Console.Write($"{text}: ");
Console.ForegroundColor = ConsoleColor.Cyan;
string input = Console.ReadLine() ?? "";
Console.ForegroundColor = previousColor;
return input;
}
catch (FormatException)
{
throw;
}
}
}