Example #1
0
        public void MainMenuControls(List <Games> userLibrary, List <Users> userList, Users user, List <Games> gameLibrary, ConsoleKeyInfo option)
        {
            switch (option.Key)
            {
            case ConsoleKey.NumPad1:
                ShowMainTopBar(user);
                ShowUserLibrary(user, userLibrary, userList, gameLibrary);
                break;

            case ConsoleKey.NumPad2:
                Console.WriteLine("Open Store");
                break;

            case ConsoleKey.NumPad3:
                Console.WriteLine("Show List Friends");
                break;

            case ConsoleKey.NumPad4:
                ShowUserProfileInfo(userLibrary, userList, user, gameLibrary);
                break;

            case ConsoleKey.NumPad5:
                DataManager dataManager = new DataManager();
                dataManager.WriteDataFile(userList, dataManager.pathUsersDataFile, user.Properties());
                LoginMenu login = new LoginMenu();
                login.ShowLoginMenu(gameLibrary, userList);
                break;
            }
        }
Example #2
0
        private static void Main(string[] args)
        {
            DataManager dataManager = new DataManager();

            dataManager.CheckIfFolderExists();

            Games        games       = new Games();
            List <Games> gameLibrary = new List <Games>();

            dataManager.CheckIfDataFileExists(gameLibrary, dataManager.pathGamesDataFile, games.Properties());

            List <Users> userList = new List <Users>();
            Users        user     = new Users();

            dataManager.CheckIfDataFileExists(userList, dataManager.pathUsersDataFile, user.Properties());

            LoginMenu login = new LoginMenu();

            login.ShowLoginMenu(gameLibrary, userList);
        }
Example #3
0
        private void SelectInMenu(List <Games> gameLibrary, List <Users> userList)
        {
            Games          games = new Games();
            ConsoleKeyInfo option;

            option = Console.ReadKey(true);

            switch (option.Key)
            {
            case ConsoleKey.NumPad1:

                ShowLibrary(gameLibrary, userList);
                break;

            case ConsoleKey.NumPad2:
                AddNewGame(gameLibrary, userList);
                break;

            case ConsoleKey.NumPad3:
                SelectDeleteGame(gameLibrary, userList);
                break;

            case ConsoleKey.NumPad4:
                ShowUsersMenu(gameLibrary, userList);
                break;

            case ConsoleKey.NumPad5:
                dataManager.WriteDataFile(gameLibrary, dataManager.pathGamesDataFile, games.Properties());
                LoginMenu login = new LoginMenu();
                login.ShowLoginMenu(gameLibrary, userList);
                break;

            default:
                Console.WriteLine("Choose one of the Options");
                SelectInMenu(gameLibrary, userList);
                break;
            }
        }