-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (37 loc) · 1.09 KB
/
Program.cs
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
using ReachTheFlag.Game;
using ReachTheFlag.UI;
AvailableGameUI ChooseGameUI()
{
AvailableGameUI? chosenUI = null;
while (chosenUI is null)
{
Console.WriteLine("Choose display style: ");
Console.WriteLine("1. Terminal ");
Console.WriteLine("2. GUI (Raylib) ");
char pressedKey = Console.ReadKey(true).KeyChar;
string type = pressedKey.ToString().ToLower();
Console.Clear();
if (Enum.TryParse(type, out AvailableGameUI ui) && Enum.IsDefined(ui))
{
chosenUI = ui;
}
}
return (AvailableGameUI)chosenUI;
}
void Main()
{
// For displaying emojis in windows temrinal correctly
Console.OutputEncoding = System.Text.Encoding.UTF8;
ReachTheFlagGame game = new ReachTheFlagGame();
var ui = ChooseGameUI();
game.SetUserInterface(ui);
game.UserInterface.Run();
}
Main();
//void TestAlgorithmRuntimes()
//{
// GamePerformanceTest testSuite = new GamePerformanceTest();
// testSuite.CalculateAndDisplayAverageRuntimes(2);
// Console.WriteLine();
//}
//TestAlgorithmRuntimes();