コード例 #1
0
ファイル: Narrator.cs プロジェクト: Menuka5/testc
        public void gameBegin(PlayerOne playerOne, PlayerTwo playerTwo)
        {
            List <string> pOne = new List <string>();
            List <string> pTwo = new List <string>();

            pOne.Add("one");
            pOne.Add(playerOne.sendRandomCard());
            pTwo.Add("two");
            this.player1 = playerOne;
            this.player2 = playerTwo;

            //Console.WriteLine(" random" + pOne[1]);


            IEnumerable <string> pTwoSendCards = playerTwo.sendSimilarCards(pOne[1]);

            //Console.WriteLine(pTwoSendCards.Any() + " "+pTwoSendCards.Count());
            //if (true)
            if (!pTwoSendCards.Any())
            {
                pTwo.Add(playerTwo.sendRandomCard());
                playerOneScore++;
                playerOne.removeCard(pOne[1]);
                playerTwo.removeCard(pTwo[1]);
            }
            else
            {
            }

            Console.WriteLine(playerOneScore);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Narrator narrator = new Narrator();

            narrator.initiate();
            //narrator.sendCards();

            PlayerOne playerOne = new PlayerOne(narrator.sendCards());
            PlayerTwo playerTwo = new PlayerTwo(narrator.sendCards());

            narrator.gameBegin(playerOne, playerTwo);
            narrator.NextTurn();
            //narrator.printCurrentPack();

            //playerOne.currentPack();
            //playerTwo.currentPack();
            Console.Read();
        }