コード例 #1
0
        static void Main(string[] args)
        {
            int numberOfPlayers;

            NumberOfPlayers numberofplayers = new NumberOfPlayers();
            Player1 player1 = new Player1();
            Player2 player2 = new Player2();
            PlayerChooseShape shapechoice = new PlayerChooseShape();
            CheckWinner checkwinner = new CheckWinner();
            UserChooseGameMode userchoosegamemode = new UserChooseGameMode();
            UserPickHandSign userpickhandsign = new UserPickHandSign();
            DisplayScore displayscore = new DisplayScore();
            WriteToDocument writetodocument = new WriteToDocument();
            ReadFromDocument readfromdocument = new ReadFromDocument();


            readfromdocument.WriteDocumentData();

            numberOfPlayers = userchoosegamemode.pickNumberOfPlayers(player1, player2, numberofplayers);

            userpickhandsign.pickHandSign(numberOfPlayers, checkwinner, shapechoice, player1, player2);

            checkwinner.getScore();

            displayscore.DisplayWinner(player1, player2, checkwinner);

            checkwinner.SignClassOutput();

            writetodocument.writeTextToDocument(player1, player2);

            Console.ReadLine();
        }
コード例 #2
0
        public int pickNumberOfPlayers(Player1 player1, Player2 player2, NumberOfPlayers numberofplayers)
        {
            int  numberOfPlayers;
            bool userPicksValidNumber = false;

            numberOfPlayers = numberofplayers.getNumberOfPlayers();

            while (userPicksValidNumber == false)
            {
                switch (numberOfPlayers)
                {
                case 2:
                    userPicksValidNumber = true;
                    player1.getPlayer1name();
                    player2.getPlayer2name();
                    break;

                case 1:
                    userPicksValidNumber = true;
                    player1.getPlayer1name();
                    player2.Player2Name = "HAL 9K";
                    break;

                default:
                    numberOfPlayers = numberofplayers.getNumberOfPlayers();
                    break;
                }
            }

            return(numberOfPlayers);
        }
コード例 #3
0
        public int pickNumberOfPlayers (Player1 player1, Player2 player2, NumberOfPlayers numberofplayers)
        {
            int numberOfPlayers;
            bool userPicksValidNumber = false;
            numberOfPlayers = numberofplayers.getNumberOfPlayers();

            while (userPicksValidNumber == false)
            {
                switch (numberOfPlayers)
                {
                    case 2:
                        userPicksValidNumber = true;
                        player1.getPlayer1name();
                        player2.getPlayer2name();
                        break;
                    case 1:
                        userPicksValidNumber = true;
                        player1.getPlayer1name();
                        player2.Player2Name = "HAL 9K";
                        break;
                    default:
                        numberOfPlayers = numberofplayers.getNumberOfPlayers();
                        break;
                }
            }

            return numberOfPlayers;
                    }