예제 #1
0
        public static FavoritesMenu GetInstance()
        {
            if (TheOneFavoritesMenu == null)
            {
                TheOneFavoritesMenu = new FavoritesMenu();
            }

            return(TheOneFavoritesMenu);
        }
예제 #2
0
        private void UpdateFavorites(ConsoleKey pressedKey)
        {
            string option = Pages[CurrentlyOpenPageIndex].PageOptions[HoveredOptionIndex].OptionString;

            if (pressedKey == ConsoleKey.F)
            {
                FavoritesMenu.GetInstance().AddFavorite(option);
            }
            else
            {
                FavoritesMenu.GetInstance().RemoveFavorite(option);
            }
        }
예제 #3
0
        public static IMenu GetMenuFromString(string menuString)
        {
            IMenu returnMenu = null;

            switch (menuString)
            {
            case HomeMenu.HOME_MENU_STRING:
            {
                returnMenu = HomeMenu.GetInstance();
                break;
            }

            case HangmanMenu.HANGMAN_MENU_STRING:
            {
                returnMenu = HangmanMenu.GetInstance();
                break;
            }

            case LineRaceMenu.LINE_RACE_MENU_STRING:
            {
                returnMenu = LineRaceMenu.GetInstance();
                break;
            }

            case QuackMenu.QUACK_MENU_STRING:
            {
                returnMenu = QuackMenu.GetInstance();
                break;
            }

            case CreditsMenu.CREDITS_MENU_STRING:
            {
                returnMenu = CreditsMenu.GetInstance();
                break;
            }

            case FavoritesMenu.FAVORITES_MENU_STRING:
            {
                returnMenu = FavoritesMenu.GetInstance();
                break;
            }

            case EscapeMenu.ESCAPE_MENU_STRING:
            {
                returnMenu = EscapeMenu.GetInstance();
                break;
            }

            case NumberGuessingGameMenu.NUMBER_GUESSING_GAME_MENU_STRING:
            {
                returnMenu = NumberGuessingGameMenu.GetInstance();
                break;
            }

            default:
            {
                returnMenu = null;
                break;
            }
            }

            return(returnMenu);
        }