コード例 #1
0
        public IMenu GetNextMenu()
        {
            Console.ReadKey();

            // Only way to go is home
            return(HomeMenu.GetInstance());
        }
コード例 #2
0
        public static IMenu GetInstance()
        {
            if (TheOnlyHomeMenu == null)
            {
                TheOnlyHomeMenu = new HomeMenu();
            }

            return(TheOnlyHomeMenu);
        }
コード例 #3
0
        public IMenu GetNextMenu()
        {
            Console.ReadKey();

            return(HomeMenu.GetInstance());
        }
コード例 #4
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);
        }