-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (25 loc) · 746 Bytes
/
Program.cs
File metadata and controls
27 lines (25 loc) · 746 Bytes
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
using Dice.Interfaces;
using Dice.Services;
public class Program
{
public static void Main(string[] args)
{
IConsoleWriter consoleWriter = new SpectreConsoleWriter();
try
{
ConfigurationParser parser = new ConfigurationParser();
var dice = parser.Parse(args);
IFairnessService fairnessService = new FairnessService();
Game game = new Game(dice, consoleWriter, fairnessService);
game.Play();
}
catch (ArgumentException e)
{
consoleWriter.WriteNegativeLine("Error: " + e.Message);
}
catch
{
Console.WriteLine("An unexpected error occurred. Please try again.");
}
}
}