Пример #1
0
        public DurakGameClass(int deckSize, HumanPlayer playerData)
        {
            // Deck Setup
            this.GameDeck = new Deck(true, true, deckSize);

            // Setup Trump
            this.TrumpCard = GameDeck.GetCard((PLAYER_COUNT * 6) + 1);
            Card.trump     = this.TrumpCard.suit;
            GameDeck.RemoveCard((PLAYER_COUNT * 6) + 1);

            // Player Setup
            regularPlayer = playerData;
            regularPlayer.dealPlayerHand(this.GameDeck);

            //WriteLog("Player Hand:\n" + regularPlayer.Hand.ToString());

            // Ai Setup
            aiPlayer = new AIPlayer();
            aiPlayer.dealPlayerHand(this.GameDeck);

            //WriteLog("AI Hand:\n" + aiPlayer.Hand.ToString());

            //Bout Setup
            currentBout = new Bout();

            // Determine First Attack
            Random rand = new Random();

            currentBout.playerTurn = rand.Next(0, 1);
        }
Пример #2
0
        public void RemoveCardTestMethod1()
        {
            GameDeck deck = new GameDeck(1, new List <int> {
                1, 2
            });
            int id = 0;

            deck.OnCardsChanged += (eventDeck, eventID, changeCode) =>
            {
                if (changeCode == Protocol.DataChangeCode.Remove)
                {
                    id = eventID;
                }
            };
            deck.RemoveCard(2);
            Assert.AreEqual(2, id);
        }