示例#1
0
        public static IMenu GetInstance()
        {
            if (TheOnlyHangmanMenu == null)
            {
                TheOnlyHangmanMenu = new HangmanMenu();
            }

            return(TheOnlyHangmanMenu);
        }
示例#2
0
        public IMenu GetNextMenu()
        {
            IMenu nextMenu = ArrowedMenu.GetInstance().GetNextMenu();

            // If it is null then quit was selected
            if (nextMenu == null)
            {
                StartHangman();

                nextMenu = HangmanMenu.GetInstance();
            }

            return(nextMenu);
        }
示例#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);
        }