-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtility.cs
More file actions
128 lines (115 loc) · 5.14 KB
/
Utility.cs
File metadata and controls
128 lines (115 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rift.ModernRift.Core
{
#region Exceptions
public class ConfigurationFileNotFoundException : Exception
{
public ConfigurationFileNotFoundException() { }
public ConfigurationFileNotFoundException(string message) : base(message) { }
public ConfigurationFileNotFoundException(string message, Exception inner) : base(message, inner) { }
}
public class ConfigurationIncompleteException : Exception
{
public ConfigurationIncompleteException() { }
public ConfigurationIncompleteException(string message) : base(message) { }
public ConfigurationIncompleteException(string message, Exception inner) : base(message, inner) { }
}
public class ConfigurationNotSetException : Exception
{
public ConfigurationNotSetException() { }
public ConfigurationNotSetException(string message) : base(message) { }
public ConfigurationNotSetException(string message, Exception inner) : base(message, inner) { }
}
public class InvalidAliasException : Exception
{
public InvalidAliasException() { }
public InvalidAliasException(string message) : base(message) { }
public InvalidAliasException(string message, Exception inner) : base(message, inner) { }
}
public class ProtectedCommandException : Exception
{
public ProtectedCommandException() { }
public ProtectedCommandException(string message) : base(message) { }
public ProtectedCommandException(string message, Exception inner) : base(message, inner) { }
}
public class ProtectedDirectiveException : Exception
{
public ProtectedDirectiveException() { }
public ProtectedDirectiveException(string message) : base(message) { }
public ProtectedDirectiveException(string message, Exception inner) : base(message, inner) { }
}
public class FilePathInvalidException : Exception
{
public FilePathInvalidException() { }
public FilePathInvalidException(string message) : base(message) { }
public FilePathInvalidException(string message, Exception inner) : base(message, inner) { }
}
public class GameReferenceNullException : Exception
{
public GameReferenceNullException() { }
public GameReferenceNullException(string message) : base(message) { }
public GameReferenceNullException(string message, Exception inner) : base(message, inner) { }
}
public class GameAlreadyInitializedException : Exception
{
public GameAlreadyInitializedException() { }
public GameAlreadyInitializedException(string message) : base(message) { }
public GameAlreadyInitializedException(string message, Exception inner) : base(message, inner) { }
}
public class GameAlreadyRunningException : Exception
{
public GameAlreadyRunningException() { }
public GameAlreadyRunningException(string message) : base(message) { }
public GameAlreadyRunningException(string message, Exception inner) : base(message, inner) { }
}
public class GameNotRunningException : Exception
{
public GameNotRunningException() { }
public GameNotRunningException(string message) : base(message) { }
public GameNotRunningException(string message, Exception inner) : base(message, inner) { }
}
public class GameNotInitializedException : Exception
{
public GameNotInitializedException() { }
public GameNotInitializedException(string message) : base(message) { }
public GameNotInitializedException(string message, Exception inner) : base(message, inner) { }
}
public class ConsoleColorInvalidException : Exception
{
public ConsoleColorInvalidException() { }
public ConsoleColorInvalidException(string message) : base(message) { }
public ConsoleColorInvalidException(string message, Exception inner) : base(message, inner) { }
}
public static class ConsoleManager
{
public static ConsoleColor StringToConsoleColor(string color)
{
color = color.ToLower();
return color switch
{
"black" => ConsoleColor.Black,
"darkblue" => ConsoleColor.DarkBlue,
"darkgreen" => ConsoleColor.DarkGreen,
"darkcyan" => ConsoleColor.DarkCyan,
"darkred" => ConsoleColor.DarkRed,
"darkmagenta" => ConsoleColor.DarkMagenta,
"darkyellow" => ConsoleColor.DarkYellow,
"gray" => ConsoleColor.Gray,
"darkgray" => ConsoleColor.DarkGray,
"blue" => ConsoleColor.Blue,
"green" => ConsoleColor.Green,
"cyan" => ConsoleColor.Cyan,
"red" => ConsoleColor.Red,
"magenta" => ConsoleColor.Magenta,
"yellow" => ConsoleColor.Yellow,
"white" => ConsoleColor.White,
_ => throw new ConsoleColorInvalidException("The color specified was not a valid ConsoleColor.")
};
}
}
#endregion
}