Example #1
0
        public async Task RunAsync()
        {
            var json     = File.ReadAllText("settings.json");
            var settings = JsonConvert.DeserializeObject <Settings>(json);

            client             = new HttpClient();
            client.BaseAddress = new Uri(settings.BaseAddress);
            Authentification auth         = new Authentification(client);
            Login            login        = new Login(auth);
            Registration     registration = new Registration(auth);
            LeaderBoard      leaderBoard  = new LeaderBoard(client);
            MainMenu         mainMenu     = new MainMenu(login, registration, leaderBoard);
            await mainMenu.RunMainMenuAsync();
        }
Example #2
0
        public MainMenu(Login login, Registration registration, LeaderBoard leaderBoard)
        {
            string logo = @" _____ _            _____                      
|_   _| |          |  __ \                     
  | | | |__   ___  | |  \/ __ _ _ __ ___   ___ 
  | | | '_ \ / _ \ | | __ / _` | '_ ` _ \ / _ \
  | | | | | |  __/ | |_\ \ (_| | | | | | |  __/
  \_/ |_| |_|\___|  \____/\__,_|_| |_| |_|\___|
                                               
                                               ";

            string[] options = new string[] { "Login", "Registration", "LeaderBoard", "Exit" };
            menu              = new Menu(logo, options);
            this.login        = login;
            this.registration = registration;
            this.leaderBoard  = leaderBoard;
        }