public override void Start()
        {
            Running = true;
            Console.CursorVisible   = false;
            Console.ForegroundColor = ConsoleColor.Black;

            DrawMenu();
            do
            {
                HandleInput();
                UpdateTitle();
            } while (Running && User.NumberOfMoviesRated < 10 && UsedNumbers.Count / 10 + 1 <= 20);

            if (User.NumberOfMoviesRated >= 10 && UsedNumbers.Count % 10 == 0) // makes sure that only one startpage is created, a bool could maybe be created with a adress pointer to each class instead?
            {
                Menu loggedInMenu = new Startmenu($"Welcome {User.Username}!");

                loggedInMenu.Start();
                UsedNumbers.Add(0);
            }
            else if (UsedNumbers.Count % 10 == 0)
            {
                Console.Clear();
                PrintStringColored("ERROR: You need to rate 10 movies for the system to work", ConsoleColor.Red);
                Console.WriteLine("\nPress any key to continue");
                UsedNumbers.Add(0);
                Console.ReadKey();
            }
        }
Esempio n. 2
0
        public override void Select()
        {
            Console.Clear();

            Console.Write("Username: "******"Password: "******"\nYou are now logged in", ConsoleColor.Green);
                Console.WriteLine("Press any key to continue");
                Console.ReadKey();

                new User(username[0], debug);

                if (User.NumberOfMoviesRated < 10 && !coldstart)
                {
                    ColdStart coldStartMenu = new ColdStart($"Cold Start - you have rated {User.NumberOfMoviesRated} out of 10 movies");
                    coldStartMenu.Select();
                }
                else
                {
                    Menu loggedInMenu = new Startmenu($"Welcome {User.Username}!");
                    loggedInMenu.Start();
                }
            }
            else
            {
                PrintStringColored("\nWrong password or username", ConsoleColor.Red);
                Console.ReadKey();
            }
        }