Пример #1
0
        public static int MenuServer(List <string> options, bool exit)
        {
            ConsoleOptionsInterface optionsMenu = new ConsoleOptionsInterface(options, exit, false);
            int optionSelected = optionsMenu.Launch();

            return(optionSelected);
        }
Пример #2
0
        public override int GetCorrespondingOrientationNum(int[] firstCoordinate)//gets user input
        {
            Console.WriteLine("\nPlease enter which direction to place your ship from the starting coordinate " + ConvertCoordinate(firstCoordinate) + ", that you entered: ");
            List <string> orientationOptions = new List <string> {
                "Up", "Down", "Left", "Right"
            };
            ConsoleOptionsInterface orientationMenu = new ConsoleOptionsInterface(orientationOptions, false, false);
            int numericSelection = orientationMenu.Launch();

            return(numericSelection);
        }
Пример #3
0
        public override Gestures GetGesture()
        {
            Console.WriteLine("\nIt is " + name + "'s turn to pick a gesture.");
            int option = gestureChoices.Launch();

            option -= 1;
            foreach (Gestures gesture in gestures)
            {
                if (option == gestures.IndexOf(gesture))
                {
                    currentGesture = gesture;
                }
            }
            return(currentGesture);
        }
Пример #4
0
        public void Run()
        {
            List <string> startOptions = new List <string> {
                "Play single player", "Play multiplayer", "Spectator Mode(Comp vs Comp)"
            };
            ConsoleOptionsInterface startMenu = new ConsoleOptionsInterface(startOptions, true, false);
            bool runGame = true;

            while (runGame == true)
            {
                int optionSelected = startMenu.Launch();//If optionSelected == 4, program automatically terminated.
                playersList = Setup.LoadBattleConsoles(optionSelected);
                playerOne   = playersList[0];
                playerTwo   = playersList[1];
                playerOne.SetBoard();
                playerTwo.SetBoard();
                TurnCycle(RandNumGen.GenerateRand(0, 2));
            }
        }
Пример #5
0
        static void Main(string[] args)
        {
            bool          runProgram     = true;
            List <string> optionsStrings = new List <string> {
                "Create tournament", "See tournament rules"
            };
            ConsoleOptionsInterface optionsMenu = new ConsoleOptionsInterface(optionsStrings, true, false);
            Setup setupTournament = new Setup();

            do
            {
                setupTournament.WelcomeMessage();
                int selectedOption = optionsMenu.Launch();
                if (selectedOption == 1)
                {
                    setupTournament.Launch();
                }
                else if (selectedOption == 2)
                {
                    Rules.DisplayRules();
                }
            } while (runProgram == true);
        }