Exemplo n.º 1
0
 private void InitMainMenu()
 {
     mainMenuOption = MainMenuOption.play;
     bg_Play.SetActive(false);
     bg_Credit.SetActive(true);
     bg_Quit.SetActive(true);
 }
Exemplo n.º 2
0
        private void ExecuteMenuSelection(MainMenuOption option)
        {
            switch (option)
            {
            case MainMenuOption.InValid:
                _logger.LogWarning("Attempted to execute invalid menu selection");
                break;

            case MainMenuOption.RecipeMenu:
                Console.WriteLine();
                _recipeMenu.Show();
                break;

            case MainMenuOption.IngredientMenu:
                Console.WriteLine();
                _ingredientMenu.Show();
                break;

            case MainMenuOption.Quit:
                Environment.Exit(0);
                break;

            default:
                break;
            }
        }
    void LookAtOptions()
    {
        MainMenuOption selectedOption = null;

        RaycastHit hit;

        if (Physics.Linecast(hmdCamera.transform.position, hmdCamera.transform.position + hmdCamera.transform.forward * 10.0f, out hit))
        {
            hit.collider.gameObject.transform.parent.gameObject.GetComponent <MainMenuOption>().selected = true;
            selectedOption = hit.collider.gameObject.transform.parent.gameObject.GetComponent <MainMenuOption>();
        }

        for (int i = 0; i < options.Length; i++)
        {
            if (selectedOption == null || selectedOption != options[i])
            {
                options[i].selected = false;
            }
        }

        if ((rightController.codesSetup && rightController.controller.GetPressDown(rightController.controllerButtonCodes.touchPadButton)) || (leftController.codesSetup && leftController.controller.GetPressDown(leftController.controllerButtonCodes.touchPadButton)))
        {
            if (selectedOption != null)
            {
                // Select Option
                SceneManager.LoadScene(selectedOption.levelName, LoadSceneMode.Single);
            }
        }
    }
Exemplo n.º 4
0
    public void SubmitTrigger(BaseEventData data)
    {
        //Debug.Log("Submit triggered.");

        switch (option)
        {
        case MainMenuOption.Play:
            StopCoroutine("Blink");
            mText.text = instructions + BOX;
            StartCoroutine("Blink");
            option = MainMenuOption.Next;
            break;

        case MainMenuOption.Credits:
            Credits();
            break;

        case MainMenuOption.Exit:
            StartCoroutine(Type(0f, "\n\nGoodbye.", 1.3f, () => Application.Quit()));
            break;

        case MainMenuOption.Next:
            StopAllCoroutines();
            SceneManager.LoadScene("Quirkless");
            break;

        default:
            break;
        }
    }
Exemplo n.º 5
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer("Resources/Start/NO.wav");

            player.Play();
            this.menuState    = MainMenuOption.ExitGame;
            base.DialogResult = DialogResult.No;
        }
Exemplo n.º 6
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer("Resources/Start/OK.wav");

            player.Play();
            this.menuState = MainMenuOption.About;
            new formAbout().ShowDialog();
        }
Exemplo n.º 7
0
 private void btnOptions_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.Options;
     formOptions options = new formOptions();
     if (options.ShowDialog() == DialogResult.OK)
     {
     }
 }
        private void btnOptions_Click(object sender, EventArgs e)
        {
            this.menuState = MainMenuOption.Options;
            formOptions options = new formOptions();

            if (options.ShowDialog() == DialogResult.OK)
            {
            }
        }
Exemplo n.º 9
0
 void SetOption(int index)
 {
     current           = (MainMenuOption)index;
     selector.position = menuOptions.GetChild((int)current).position;
     for (int i = 0; i < menuOptions.childCount; i++)
     {
         menuOptions.GetChild(i).GetComponent <Text>().color = inactiveColor;
     }
     menuOptions.GetChild((int)current).GetComponent <Text>().color = Color.white;
 }
Exemplo n.º 10
0
        private void AdjustMenuOption(int value)
        {
            var newOptionValue = (int)_selectedMenuOption + value;

            newOptionValue %= (int)MainMenuOption.Count;
            if (newOptionValue < 0)
            {
                newOptionValue += (int)MainMenuOption.Count;
            }
            _selectedMenuOption = (MainMenuOption)newOptionValue;
        }
Exemplo n.º 11
0
 private void btnLoadFile_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.LoadGame;
     formSelectSaveFile file = new formSelectSaveFile();
     if (file.ShowDialog() == DialogResult.OK)
     {
         this.mainGame.LoadScenarioInInitialization = false;
         this.mainGame.InitializationFileName = file.SaveFilePath;
         base.DialogResult = DialogResult.OK;
     }
 }
 private void formMainMenu_Click(object sender, EventArgs e)
 {
     if (this.menuState == MainMenuOption.Logo)
     {
         this.menuState = MainMenuOption.Selecting;
         this.btnStartNewGame.Visible = true;
         this.btnLoadFile.Visible     = true;
         this.btnOptions.Visible      = true;
         this.btnAbout.Visible        = true;
         this.btnExitGame.Visible     = true;
     }
 }
Exemplo n.º 13
0
 private void btnStartNewGame_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.StartGame;
     formSelectScenario scenario = new formSelectScenario();
     if (scenario.ShowDialog() == DialogResult.OK)
     {
         this.mainGame.LoadScenarioInInitialization = true;
         this.mainGame.InitializationFileName = scenario.ScenarioPath;
         this.mainGame.InitializationFactionIDs = scenario.SelectedFactionIDs;
         base.DialogResult = DialogResult.OK;
     }
 }
Exemplo n.º 14
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer("Resources/Start/OK.wav");

            player.Play();
            this.menuState = MainMenuOption.Options;
            formOptions options = new formOptions();

            if (options.ShowDialog() == DialogResult.OK)
            {
            }
        }
        private void btnLoadFile_Click(object sender, EventArgs e)
        {
            this.menuState = MainMenuOption.LoadGame;
            formSelectSaveFile file = new formSelectSaveFile();

            if (file.ShowDialog() == DialogResult.OK)
            {
                this.mainGame.LoadScenarioInInitialization = false;
                this.mainGame.InitializationFileName       = file.SaveFilePath;
                base.DialogResult = DialogResult.OK;
            }
        }
        private void btnStartNewGame_Click(object sender, EventArgs e)
        {
            this.menuState = MainMenuOption.StartGame;
            formSelectScenario scenario = new formSelectScenario();

            if (scenario.ShowDialog() == DialogResult.OK)
            {
                this.mainGame.LoadScenarioInInitialization = true;
                this.mainGame.InitializationFileName       = scenario.ScenarioPath;
                this.mainGame.InitializationFactionIDs     = scenario.SelectedFactionIDs;
                base.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 17
0
        private void MainMenuNext()
        {
            if (Input.GetAxis("LeftJoyStickY_ANYPLAYER") > 0)
            {
                //AudioManager.instance.Play("Move_Through_Menu_Panels");
                isPressNext = true;
            }
            if (isPressNext)
            {
                if (Input.GetAxis("LeftJoyStickY_ANYPLAYER") == 0)
                {
                    AudioManager.instance.Play("Move_Through_Menu_Panels");
                    isPressNext        = false;
                    isPressNextRelease = true;
                }
            }
            if (isPressNextRelease)
            {
                isPressNextRelease = false;

                switch (mainMenuOption)
                {
                case MainMenuOption.play:
                    mainMenuOption = MainMenuOption.credit;
                    bg_Play.SetActive(true);
                    bg_Credit.SetActive(false);
                    bg_Quit.SetActive(true);
                    break;

                case MainMenuOption.credit:
                    mainMenuOption = MainMenuOption.quit;
                    bg_Play.SetActive(true);
                    bg_Credit.SetActive(true);
                    bg_Quit.SetActive(false);
                    break;

                case MainMenuOption.quit:
                    mainMenuOption = MainMenuOption.play;
                    bg_Play.SetActive(false);
                    bg_Credit.SetActive(true);
                    bg_Quit.SetActive(true);
                    break;

                default:
                    Debug.Log("Unexpected Player Number Selection Option");
                    break;
                }
            }
        }
Exemplo n.º 18
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer("Resources/Start/Open.wav");

            player.Play();
            this.menuState = MainMenuOption.LoadGame;
            formSelectSaveFile file = new formSelectSaveFile();

            if (file.ShowDialog() == DialogResult.OK)
            {
                this.mainGame.LoadScenarioInInitialization = false;
                this.mainGame.InitializationFileName       = file.SaveFilePath;
                base.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 19
0
    public void MoveTrigger(AxisEventData data)
    {
        string result = mText.text;

        switch (data.moveDir)
        {
        case MoveDirection.Up:
            result = result.Replace("< ", "");
            result = result.Replace(" >", "");
            option = PrevOption();
            if (option == MainMenuOption.Play)
            {
                result = result.Replace("Play", "< Play >");
            }
            else if (option == MainMenuOption.Credits)
            {
                result = result.Replace("Credits", "< Credits >");
            }
            else
            {
                result = result.Replace("Exit", "< Exit >");
            }
            mText.text = result;
            break;

        case MoveDirection.Down:
            result = result.Replace("< ", "");
            result = result.Replace(" >", "");
            option = NextOption();
            if (option == MainMenuOption.Play)
            {
                result = result.Replace("Play", "< Play >");
            }
            else if (option == MainMenuOption.Credits)
            {
                result = result.Replace("Credits", "< Credits >");
            }
            else
            {
                result = result.Replace("Exit", "< Exit >");
            }
            mText.text = result;
            break;

        default:
            break;
        }
    }
Exemplo n.º 20
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer("Resources/Start/Open.wav");

            player.Play();
            this.menuState = MainMenuOption.StartGame;
            formSelectScenario scenario = new formSelectScenario();

            if (scenario.ShowDialog() == DialogResult.OK)
            {
                this.mainGame.LoadScenarioInInitialization = true;
                this.mainGame.InitializationFileName       = scenario.ScenarioPath;
                this.mainGame.InitializationFactionIDs     = scenario.SelectedFactionIDs;
                base.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 21
0
        public static void MainMenu()
        {
            Console.Write(Constant.MainMenuOption);
            MainMenuOption option = (MainMenuOption)Helper.ValidInteger();

            switch (option)
            {
            case MainMenuOption.Login:
                try
                {
                    User user = AppDataServices.Authentication(UserInput.GetCredential());

                    if (user != null)
                    {
                        Menu menu = new Menu(user.Id);
                        menu.UserMainMenu();
                    }
                    else
                    {
                        Console.WriteLine(Constant.InvalidUserIdPassword);
                    }
                }

                catch (Exception)
                {
                    Console.WriteLine(Constant.InvalidUserIdPassword);
                }
                MainMenu();

                break;

            case MainMenuOption.Signup:
                AppDataServices.AddNewUser(UserInput.NewUser());
                MainMenu();

                break;

            case MainMenuOption.Exit:
                Environment.Exit(0);

                break;
            }
        }
Exemplo n.º 22
0
        private void buildMainMenu()
        {
            if (this._userSession != null)
            {
                // All users have these options.
                MainMenuOption mmoSetup = new MainMenuOption("Setup", "Setup", "Setup Tablesets", "/Setup");
                mmoSetup.MenuOptionType = MainMenuOptionType.MenuOption;
                MainMenu.Options.Add(mmoSetup);

                MainMenuOption mmoDataMgr = new MainMenuOption("Manage Data", "DataMgr", "Browse and change date", "/DataMgr");
                mmoDataMgr.MenuOptionType = MainMenuOptionType.MenuOption;
                MainMenu.Options.Add(mmoDataMgr);

                MainMenuOption mmoAdmin = new MainMenuOption("Admin", "Admin", "Administrative panel", "/Admin");
                mmoAdmin.MenuOptionType = MainMenuOptionType.MenuOption;
                MainMenu.Options.Add(mmoAdmin);

                MainMenuOption mmoSupport = new MainMenuOption("Support", "Support", "Support panel", "/Support");
                mmoSupport.MenuOptionType = MainMenuOptionType.MenuOption;
                MainMenu.Options.Add(mmoSupport);
            }
        }
Exemplo n.º 23
0
        public MainMenuOption SelectMainMenuOption()
        {
            DisplayHeader("Main Menu");
            int min = int.MaxValue;
            int max = int.MinValue;

            MainMenuOption[] options = Enum.GetValues <MainMenuOption>();
            for (int i = 0; i < options.Length; i++)
            {
                MainMenuOption option = options[i];
                if (!option.IsHidden())
                {
                    io.PrintLine($"{i}. {option.ToLabel()}");
                }
                min = Math.Min(min, i);
                max = Math.Max(max, i);
            }

            string message = $"Select [{min}-{max - 1}]: ";

            return(options[io.ReadInt(message, min, max)]);
        }
Exemplo n.º 24
0
        private void MainMenuNext()
        {
            if (Input.GetAxis("LeftJoyStickY_ANYPLAYER") > 0)
            {
                isPressNext = true;
            }
            if (isPressNext)
            {
                if (Input.GetAxis("LeftJoyStickY_ANYPLAYER") == 0)
                {
                    isPressNext        = false;
                    isPressNextRelease = true;
                }
            }
            if (isPressNextRelease)
            {
                isPressNextRelease = false;

                switch (mainMenuOption)
                {
                case MainMenuOption.play:
                    mainMenuOption = MainMenuOption.quit;
                    bg_Play.SetActive(true);
                    bg_Quit.SetActive(false);
                    break;

                case MainMenuOption.quit:
                    mainMenuOption = MainMenuOption.play;
                    bg_Play.SetActive(false);
                    bg_Quit.SetActive(true);
                    break;

                default:
                    Debug.Log("Unexpected Player Number Selection Option");
                    break;
                }
            }
        }
Exemplo n.º 25
0
        private void CreateMainMenuCategory()
        {
            var list       = new List <MainMenuOption>();
            var loadedMods = ModLoader.Instance().GetLoadedMods();

            for (var i = 0; i < loadedMods.Length; i++)
            {
                var mod  = loadedMods[i];
                var item = new MainMenuOption {
                    Name = mod.GetInfo().Name,
                    URL  = string.Empty
                };
                list.Add(item);
            }

            var mainMenuCategory = new MainMenuCategory {
                Name           = "Mods",
                Options        = list,
                WithBackOption = true
            };

            MainMenuCustomizer.Instance.AddMainMenuCategory(mainMenuCategory);
        }
Exemplo n.º 26
0
        public void Show()
        {
            while (true)
            {
                ConsoleHelper.DefaultColor = ConsoleColor.Blue;
                ConsoleHelper.ColorWriteLine(ConsoleColor.Yellow, "Welcome to CRUDRecipeEF");
                Console.WriteLine();
                ConsoleHelper.ColorWriteLine("1.) Recipe Menu");
                ConsoleHelper.ColorWriteLine("2.) Ingredient Menu");
                Console.WriteLine();
                ConsoleHelper.ColorWriteLine(ConsoleColor.Red, "3.) Quit");
                Console.WriteLine();


                string input  = string.Empty;
                int    option = 0;
                bool   valid  = false;

                while (!valid)
                {
                    ConsoleHelper.ColorWrite(ConsoleColor.Yellow, "Please select an option: ");
                    input = Console.ReadLine();

                    valid = ConsoleHelper.ValidateInt(input, (int)MainMenuOption.RecipeMenu, (int)MainMenuOption.Quit, out option);

                    if (!Enum.IsDefined(typeof(MainMenuOption), option))
                    {
                        _logger.LogWarning("Option is not in enum");
                        valid = false;
                    }
                }

                MainMenuOption choice = (MainMenuOption)option;
                ExecuteMenuSelection(choice);
            }
        }
Exemplo n.º 27
0
        public static void Run()
        {
            while (true)
            {
                MainMenuOption mainMenuOption = MainMenu.New();

                if (mainMenuOption == MainMenuOption.TwoPlayerGame)
                {
                    var game = new TwoPlayerPongGame(NewLeftPaddle(), NewRightPaddle(), new Ball());
                    game.Start();
                }
                else if (mainMenuOption == MainMenuOption.AgainstBot)
                {
                    RobotDifficultyOption difficulty = RobotDifficultyMenu.New();
                    bool isBotWithLeftPaddle         = PlayerPaddleSideMenu.New() != PaddleSideOption.Left;
                    var  game = new RobotPongGame(NewLeftPaddle(), NewRightPaddle(), new Ball(), difficulty, isBotWithLeftPaddle);
                    game.Start();
                }
                else if (mainMenuOption == MainMenuOption.Exit)
                {
                    Environment.Exit(0);
                }
            }
        }
Exemplo n.º 28
0
 void Awake()
 {
     mmOption = GetComponent <MainMenuOption>();
 }
 public static string ToLabel(this MainMenuOption option) => option switch
 {
Exemplo n.º 30
0
 private void btnExitGame_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.ExitGame;
     base.DialogResult = DialogResult.No;
 }
Exemplo n.º 31
0
 private void btnAbout_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.About;
     new formAbout().ShowDialog();
   
 }
Exemplo n.º 32
0
        /// <summary>
        /// Display the main menu
        /// </summary>
        /// <returns></returns>
        public MainMenuOption DisplayMainMenu()
        {
            MainMenuOption mainMenuOption   = MainMenuOption.None;
            int            userOptionChoice = 1;
            bool           playerConfirm    = false;
            List <int>     availableOptions = new List <int>();

            Console.CursorVisible = false;
            //loop until player presses enter
            while (!playerConfirm)
            {
                //draw header
                ConsoleUtil.HeaderText = "Main Menu";
                ConsoleUtil.DisplayReset();

                ConsoleUtil.DisplayMessage("Please Select an Option Below!");
                Console.WriteLine();

                //loop through enum options
                foreach (MainMenuOption option in Enum.GetValues(typeof(MainMenuOption)))
                {
                    //add option int value to list
                    availableOptions.Add((int)option);

                    //ignore menu option none
                    if (option != MainMenuOption.None)
                    {
                        //draw single line based on if it is the current selected option
                        if (userOptionChoice == ((int)option))
                        {
                            Console.Write("\t");
                            Console.BackgroundColor = ConsoleColor.DarkBlue;
                            Console.WriteLine($"{(int)option}. {option}");
                            Console.BackgroundColor = ConsoleColor.Black;
                        }
                        else
                        {
                            Console.WriteLine($"\t{(int)option}. {option}");
                        }
                    }
                }
                //read key
                var input = GetKey();

                switch (input.Key) //Switch on Key
                {
                case ConsoleKey.UpArrow:
                    userOptionChoice -= 1;
                    //check to see if the userOptionChoice is at the top
                    if (userOptionChoice == (availableOptions.Min()))
                    {
                        userOptionChoice = availableOptions.Max();
                    }
                    break;

                case ConsoleKey.DownArrow:
                    userOptionChoice += 1;
                    //check to see if the userOptionChoice is at the bottom
                    if (userOptionChoice == (availableOptions.Max() + 1))
                    {
                        userOptionChoice = availableOptions.Min() + 1;
                    }
                    break;

                case ConsoleKey.Enter:
                    playerConfirm  = true;
                    mainMenuOption = (MainMenuOption)userOptionChoice;
                    break;
                }
            }

            return(mainMenuOption);
        }
 private void btnAbout_Click(object sender, EventArgs e)
 {
     this.menuState = MainMenuOption.About;
     new formAbout().ShowDialog();
 }
 private void btnExitGame_Click(object sender, EventArgs e)
 {
     this.menuState    = MainMenuOption.ExitGame;
     base.DialogResult = DialogResult.No;
 }
Exemplo n.º 35
0
 private void formMainMenu_Click(object sender, EventArgs e)
 {
     if (this.menuState == MainMenuOption.Logo)
     {
         this.menuState = MainMenuOption.Selecting;
         this.btnStartNewGame.Visible = true;
         this.btnLoadFile.Visible = true;
         this.btnOptions.Visible = true;
         this.btnAbout.Visible = true;
         this.btnExitGame.Visible = true;
     }
 }
Exemplo n.º 36
0
        public static void Main(string[] args)
        {
            MessageManager  message_manager  = new MessageManager();
            MenuManager     menu_manager     = new MenuManager();
            UserManager     user_manager     = UserManager.Instance;
            DatabaseManager database_manager = DatabaseManager.Instance;

            do
            {
                try
                {
                    MainMenuOption _mainMenuOption = menu_manager.Initial_Menu();
                    switch (_mainMenuOption)
                    {
                    case MainMenuOption.Login:
                        bool successfull_login;
                        User loggedin_user = user_manager.GetCurrentUser();

                        //create a loggedin user in order to user his properties in the next menu after successfull login
                        do
                        {
                            bool correct_username, correct_password;
                            do
                            {
                                loggedin_user.Username = menu_manager.LoginMenuUsername();
                                correct_username       = user_manager.UsernameExistsinDatabase(loggedin_user.Username);
                            } while (!correct_username);
                            do
                            {
                                loggedin_user.Password = menu_manager.LoginMenuEnterPassword();
                                correct_password       = user_manager.IsPasswordCorrect(loggedin_user.Username, loggedin_user.Password);
                            } while (!correct_password);
                            successfull_login = user_manager.Login(loggedin_user.Username, loggedin_user.Password);    //pairnei ola ta stoixeia o current user otan ginetai i epikoinwnia me ti basi
                            menu_manager.LoginWasSuccessfull(loggedin_user = user_manager.GetCurrentUser());
                        } while (!successfull_login);

                        switch (loggedin_user.Usertype)
                        {
                        case UserType.User:
                        {
                            UserLoginMenuOption userLoginMenuOption;
                            do
                            {
                                userLoginMenuOption = menu_manager.User_LoggedInMenu();
                                switch (userLoginMenuOption)
                                {
                                case UserLoginMenuOption.ReadMessageBox:
                                    List <string> messages = new List <string>();
                                    messages = message_manager.ViewMessages(loggedin_user);
                                    foreach (string element in messages)
                                    {
                                        Console.WriteLine($"{element}");
                                    }
                                    Console.WriteLine("Press a key to go to back");

                                    break;

                                case UserLoginMenuOption.SentMessage:
                                    bool sent;
                                    do
                                    {
                                        menu_manager.PickAReceiver(out string receiver_username);
                                        menu_manager.SentMessage(receiver_username, out string message);
                                        sent = message_manager.SentMessage(loggedin_user, message, receiver_username);
                                        Console.WriteLine($"Sent is {sent}");
                                        Console.ReadKey();
                                    } while (!sent);
                                    break;

                                case UserLoginMenuOption.EnterChatroom:
                                    message_manager.Chatroom(loggedin_user);
                                    break;

                                case UserLoginMenuOption.ChangePersonalInfo:
                                    user_manager.Change_Personal_Info(loggedin_user);
                                    break;

                                case UserLoginMenuOption.Logout:
                                    Console.Beep();
                                    successfull_login = false;
                                    break;
                                }
                            } while (successfull_login);
                        }
                        break;

                        case UserType.Admin:
                        {
                            AdminLoginMenuOption adminLoginMenuOption;
                            do
                            {
                                adminLoginMenuOption = menu_manager.Admin_LoggedInMenu();
                                switch (adminLoginMenuOption)
                                {
                                case AdminLoginMenuOption.ReadMessageBox:
                                    List <string> messages = new List <string>();
                                    messages = message_manager.ViewMessages(loggedin_user);
                                    foreach (string element in messages)
                                    {
                                        Console.WriteLine($"{element}");
                                    }
                                    Console.WriteLine("Press a key to go to back");

                                    break;

                                case AdminLoginMenuOption.SentMessage:
                                    bool sent;
                                    do
                                    {
                                        menu_manager.PickAReceiver(out string receiver_username);
                                        menu_manager.SentMessage(receiver_username, out string message);
                                        sent = message_manager.SentMessage(loggedin_user, message, receiver_username);
                                        Console.WriteLine($"Sent is {sent}");
                                        Console.ReadKey();
                                    } while (!sent);
                                    break;

                                case AdminLoginMenuOption.EnterChatroom:
                                    message_manager.Chatroom(loggedin_user);
                                    break;

                                case AdminLoginMenuOption.ChangePersonalInfo:
                                    user_manager.Change_Personal_Info(loggedin_user);
                                    break;

                                case AdminLoginMenuOption.SelectUsertoViewhisChatHistory:
                                    message_manager.AdminWantstoSeeYourMailBox();
                                    break;

                                case AdminLoginMenuOption.DeleteaUsersMessage:
                                    message_manager.DeleteAUsersMail();
                                    break;

                                case AdminLoginMenuOption.Logout:
                                    Console.Beep();
                                    successfull_login = false;
                                    break;
                                }
                            } while (successfull_login);
                        }
                            user_manager.Logout();
                            break;

                        case UserType.SuperAdmin:
                        {
                            SuperAdmiLoginMenuOption superAdmiLoginMenuOption;
                            do
                            {
                                superAdmiLoginMenuOption = menu_manager.SuperAdmin_LoggedInMenu();
                                switch (superAdmiLoginMenuOption)
                                {
                                case SuperAdmiLoginMenuOption.ReadMessageBox:
                                    List <string> messages = new List <string>();
                                    messages = message_manager.ViewMessages(loggedin_user);
                                    foreach (string element in messages)
                                    {
                                        Console.WriteLine($"{element}");
                                    }
                                    Console.WriteLine("Press a key to go to back");

                                    break;

                                case SuperAdmiLoginMenuOption.SentMessage:
                                    bool sent;
                                    do
                                    {
                                        menu_manager.PickAReceiver(out string receiver_username);
                                        menu_manager.SentMessage(receiver_username, out string message);
                                        sent = message_manager.SentMessage(loggedin_user, message, receiver_username);
                                        Console.WriteLine($"Sent is {sent}");
                                        Console.ReadKey();
                                    } while (!sent);
                                    break;

                                case SuperAdmiLoginMenuOption.EnterChatroom:
                                    message_manager.Chatroom(loggedin_user);
                                    break;

                                case SuperAdmiLoginMenuOption.ChangePersonalInfo:
                                    user_manager.Change_Personal_Info(loggedin_user);
                                    break;

                                case SuperAdmiLoginMenuOption.AddPrivileges:
                                    user_manager.Add_Privileges();
                                    break;

                                case SuperAdmiLoginMenuOption.DeleteaUsersMessage:
                                    message_manager.DeleteAUsersMail();
                                    break;

                                case SuperAdmiLoginMenuOption.DeleteUser:
                                    user_manager.Delete_User();
                                    break;

                                case SuperAdmiLoginMenuOption.Logout:
                                    Console.Beep();
                                    successfull_login = false;
                                    break;
                                }
                            } while (successfull_login);
                        }
                            user_manager.Logout();
                            break;

                        case UserType.God:

                            GodLoginMenuOption godLoginMenuOption;
                            do
                            {
                                godLoginMenuOption = menu_manager.God_LoggedInMenu();
                                switch (godLoginMenuOption)
                                {
                                case GodLoginMenuOption.ReadMessageBox:
                                    List <string> messages = new List <string>();
                                    messages = message_manager.ViewMessages(loggedin_user);
                                    foreach (string element in messages)
                                    {
                                        Console.WriteLine($"{element}");
                                    }
                                    Console.WriteLine("Press a key to go to back");

                                    break;

                                case GodLoginMenuOption.SentMessage:
                                    bool sent;
                                    do
                                    {
                                        menu_manager.PickAReceiver(out string receiver_username);
                                        menu_manager.SentMessage(receiver_username, out string message);
                                        sent = message_manager.SentMessage(loggedin_user, message, receiver_username);
                                        Console.WriteLine($"Sent is {sent}");
                                        Console.ReadKey();
                                    } while (!sent);
                                    break;

                                case GodLoginMenuOption.EnterChatroom:
                                    message_manager.Chatroom(loggedin_user);
                                    break;

                                case GodLoginMenuOption.ChangePersonalInfo:
                                    user_manager.Change_Personal_Info(loggedin_user);
                                    break;

                                case GodLoginMenuOption.SelectUsertoViewhisChatHistory:
                                    message_manager.AdminWantstoSeeYourMailBox();
                                    break;

                                case GodLoginMenuOption.DeleteaUsersMessage:
                                    message_manager.DeleteAUsersMail();
                                    break;

                                case GodLoginMenuOption.DeleteUser:
                                    user_manager.Delete_User();
                                    break;

                                case GodLoginMenuOption.DeleteAllDatabase:
                                    database_manager.DeleteAllDatabases();
                                    break;

                                case GodLoginMenuOption.GrantSuperAdminPriveleges:
                                    user_manager.Add_Privileges();
                                    break;

                                case GodLoginMenuOption.DepositmillinDollars:
                                    user_manager.DepositOneMillionDollars();
                                    break;

                                case GodLoginMenuOption.Logout:
                                    Console.Beep();
                                    successfull_login = false;
                                    break;
                                }
                            } while (successfull_login);
                            user_manager.Logout();
                            break;
                        }
                        break;


                    case MainMenuOption.Register:

                        User tempuser = user_manager.GetCurrentUser();
                        bool successfull_register;
                        do
                        {
                            bool correct_firstname, correct_lastname, correct_username, correct_password;
                            //One by one insertion +check  of first name lastname username and password
                            do
                            {
                                tempuser.Firstname = menu_manager.RegisterMenuEnterFirstname();
                                correct_firstname  = user_manager.ValidateRegisteringFirstname(tempuser.Firstname);
                            } while (!correct_firstname);
                            do
                            {
                                tempuser.Lastname = menu_manager.RegisterMenuEnterLastname();
                                correct_lastname  = user_manager.ValidateRegisteringLastname(tempuser.Lastname);
                            } while (!correct_lastname);
                            do
                            {
                                tempuser.Username = menu_manager.RegisterMenuEnterUsername();
                                correct_username  = user_manager.ValidateRegisteringUsername(tempuser.Username);
                            } while (!correct_username);
                            do
                            {
                                tempuser.Password = menu_manager.RegisterMenuEnterPassword();
                                correct_password  = user_manager.ValidateRegisteringPassword(tempuser.Password, out string errormessage);
                                Console.WriteLine($"{errormessage}");
                                System.Threading.Thread.Sleep(1000);
                            } while (!correct_password);

                            successfull_register = user_manager.RegisterUserinDatabase(tempuser.Firstname, tempuser.Lastname, tempuser.Username, tempuser.Password);
                            user_manager.Logout();
                            tempuser = user_manager.GetCurrentUser();
                        } while (!successfull_register);    //repeat till the whole process returns a true value of the successfull register flag
                        menu_manager.SuccessfullRegister(tempuser.Username);


                        break;

                    case MainMenuOption.Exit:
                        Console.Clear();
                        Console.WriteLine("BYE BYE");
                        System.Threading.Thread.Sleep(2000);
                        Environment.Exit(0);
                        break;
                    }
                }


                catch (SystemException e)
                {
                    Console.WriteLine(e);
                }
            } while (true);
        }