コード例 #1
0
        public void InstructionsMenu()
        {
            //Instructions Menu
            List <MenuAction> actions         = _menuActionService.GetActionsForMenu("Instructions");
            string            possibleChoices = "";

            Console.Write(_textService.GetInfoOn());
            foreach (var action in actions)
            {
                Console.Write(HelperMethods.Buttonize(action.ActionName, action.KeyToChoose));
                possibleChoices += action.KeyToChoose;
            }

            char menuChoice = HelperMethods.GetChar(possibleChoices);

            HelperMethods.ClearLine();
            switch (menuChoice)
            {
            case 'a':
                ActionsInfo();
                break;

            case 's':
                StatsInfo();
                break;

            case 'b':
                //return control upwards
                break;
            }
        }
コード例 #2
0
        public void MainMenu()
        {
            //Main Menu
            List <MenuAction> actions         = _menuActionService.GetActionsForMenu("Main");
            string            possibleChoices = "";

            foreach (var action in actions)
            {
                Console.Write(HelperMethods.Buttonize(action.ActionName, action.KeyToChoose));
                possibleChoices += action.KeyToChoose;
            }

            char menuChoice = HelperMethods.GetChar(possibleChoices);

            HelperMethods.ClearLine();
            switch (menuChoice)
            {
            case 'n':
                NewGame();
                break;

            case 'i':
                _instructionsManager.InstructionsMenu();
                MainMenu();
                break;

            case 'x':
                break;
            }
        }
コード例 #3
0
        public Language ChooseLanguage()
        {
            //Language Choice Menu
            Console.Write(ChooseLanguageText.Text);
            List <MenuAction> actions         = _menuActionService.GetActionsForMenu("Lang");
            string            possibleChoices = "";

            foreach (var action in actions)
            {
                Console.Write(HelperMethods.Buttonize(action.ActionName, action.KeyToChoose));
                possibleChoices += action.KeyToChoose;
            }

            char languageCode = HelperMethods.GetChar(possibleChoices);

            HelperMethods.ClearLine();
            return(languageCode == 'p' ? Language.Polish : Language.English);
        }