示例#1
0
        public void TestDraw()
        {
            QuestMatch    game   = ScenarioCreator.EmptyGame();
            AdventureDeck deck   = new AdventureDeck(game);
            Player        player = new Player("Test Player", game);

            player.Draw(deck, 10);
            Assert.AreEqual(player.Hand.Count, 10);
            Assert.AreEqual(deck.Count, deck.DeckSize - 10);
        }
示例#2
0
        public void TransferCards()
        {
            // Transfer cards from player hand to battle area.
            KingArthur testCard   = new KingArthur(ScenarioCreator.EmptyGame());
            Hand       playerHand = new Hand(null);
            PlayerArea battleArea = new PlayerArea();

            playerHand.Add(testCard);
            playerHand.Transfer(battleArea, testCard);

            Assert.AreEqual(playerHand.Count, 0);
            Assert.AreEqual(battleArea.Count, 1);
        }
示例#3
0
        private void OnCreateGame(Player player, JToken data)
        {
            QuestMatch match = ScenarioCreator.EmptyGame(this);

            int scenario = (int)data["scenario"];

            if (scenario == 1)
            {
                match = ScenarioCreator.Scenario1(this);
            }
            if (scenario == 2)
            {
                match = ScenarioCreator.Scenario2(this);
            }

            player.Behaviour = new HumanPlayer();
            match.AddPlayer(player);
            this.matches.Add(player, match);

            this.UpdatePlayers(this.matches[player]);
        }