static void Main(string[] args) { IInputOutputDevice inputOutputDevice = new ConsoleIODevice(); IDataStorage dataStorage = new DataStorage(); IFileParser fileParser = new JsonFileParser(); IGameSettings gameSetting = new GameSettings(fileParser, "settings.json"); gameSetting.InitiateSettings(); IPhraseProvider phraseProvider = new PhraseProvider(fileParser, gameSetting.GetLanguagePath()); IDoorsGenerator doorsGenerator = new DoorsGenerator(gameSetting.GetMinDoorValue(), gameSetting.GetMaxDoorValue()); DoorsGame doorsGame = new DoorsGame(inputOutputDevice, doorsGenerator, dataStorage, phraseProvider, gameSetting); doorsGame.Run(); }
static void Main(string[] args) { DoorsGame doorsGame = new DoorsGame(); doorsGame.ShowDoors(); while (true) { try { int door = Convert.ToInt32(Console.ReadLine()); doorsGame.EnterTheDoor(door); } catch (Exception e) { Console.WriteLine(e); } } }