示例#1
0
 public Battle(MTCGUser opponentA, MTCGUser opponentB, Deck opponentADeck, Deck opponentBDeck)
 {
     this._opponentA     = opponentA;
     this._opponentB     = opponentB;
     this._opponentADeck = opponentADeck;
     this._opponentBDeck = opponentBDeck;
 }
示例#2
0
        public void SingleTurnTest()
        {
            MTCGUser UserA = new MTCGUser("Tester A", 1, 20);
            MTCGUser UserB = new MTCGUser("Tester B", 2, 20);

            Card.Card Acard1 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Acard2 = new MonsterCard("Dragon 2", 1200, Element.Water, MonsterTypes.Dragon);
            Card.Card Acard3 = new MonsterCard("Dragon 3", 1900, Element.Normal, MonsterTypes.Dragon);
            Card.Card Acard4 = new MonsterCard("Mega Goblin", 2500, Element.Fire, MonsterTypes.Goblin);

            Card.Card Bcard1 = new MonsterCard("Goblin", 1000, Element.Normal, MonsterTypes.Goblin);
            Card.Card Bcard2 = new MonsterCard("Elf", 2000, Element.Fire, MonsterTypes.FireElf);
            Card.Card Bcard3 = new MonsterCard("Wizzard", 2000, Element.Water, MonsterTypes.Wizzard);
            Card.Card Bcard4 = new MonsterCard("Mega Dragon", 2000, Element.Fire, MonsterTypes.Dragon);

            Deck DeckA = new Deck(Acard1, Acard2, Acard3, Acard4);
            Deck DeckB = new Deck(Bcard1, Bcard2, Bcard3, Bcard4);

            Battle battle1 = new Battle(UserA, UserB, DeckA, DeckB);

            battle1.battleTurnMonsterOnly(DeckA._card1, DeckB._card1);
            Assert.AreEqual(battle1.turnWinner, UserA);

            battle1.battleTurnMonsterOnly(DeckA._card3, DeckB._card3);
            Assert.AreEqual(battle1.turnWinner, UserB);
        }
示例#3
0
        public void TestAddCoins()
        {
            MTCGUser user1 = new MTCGUser("Tester", 1, 20);

            user1.addCoins(5);
            Assert.AreEqual(user1.Coinbalance, 25);
        }
示例#4
0
        public void TestRemoveCoins()
        {
            MTCGUser user1 = new MTCGUser("Tester", 1, 20);

            user1.removeCoins(5);
            Assert.AreEqual(user1.Coinbalance, 15);
            user1.removeCoins(30);
            Assert.AreEqual(user1.Coinbalance, 0);
        }
示例#5
0
 public void battleTurnMonsterOnly(Card.Card cardA, Card.Card cardB)
 {
     if (cardA.Attack > cardB.Attack)
     {
         turnWinner = _opponentA;
     }
     else if (cardA.Attack < cardB.Attack)
     {
         turnWinner = _opponentB;
     }
     else
     {
     }
 }
示例#6
0
        static void Main(string[] args)
        {
            MTCGUser UserA = new MTCGUser("Tester A", 1, 20);
            MTCGUser UserB = new MTCGUser("Tester B", 2, 20);

            Card.Card Acard1 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Acard2 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Acard3 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Acard4 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);

            Card.Card Bcard1 = new MonsterCard("Goblin", 1000, Element.Normal, MonsterTypes.Goblin);
            Card.Card Bcard2 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Bcard3 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Bcard4 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);

            Deck DeckA = new Deck(Acard1, Acard2, Acard3, Acard4);
            Deck DeckB = new Deck(Bcard1, Bcard2, Bcard3, Bcard4);

            Battle battle1 = new Battle(UserA, UserB, DeckA, DeckB);

            battle1.battleTurnMonsterOnly(DeckA._card1, DeckB._card1);
        }
示例#7
0
        public void TestIsInDeck()
        {
            MTCGUser UserA = new MTCGUser("Tester A", 1, 20);
            MTCGUser UserB = new MTCGUser("Tester B", 2, 20);

            Card.Card Acard1 = new MonsterCard("Dragon", 2000, Element.Fire, MonsterTypes.Dragon);
            Card.Card Acard2 = new MonsterCard("Dragon 2", 1200, Element.Water, MonsterTypes.Dragon);
            Card.Card Acard3 = new MonsterCard("Dragon 3", 2000, Element.Normal, MonsterTypes.Dragon);
            Card.Card Acard4 = new MonsterCard("Dragon 4", 500, Element.Fire, MonsterTypes.Dragon);

            Card.Card Bcard1 = new MonsterCard("Goblin", 1000, Element.Normal, MonsterTypes.Goblin);
            Card.Card Bcard2 = new MonsterCard("Elf", 2000, Element.Fire, MonsterTypes.FireElf);
            Card.Card Bcard3 = new MonsterCard("Wizzard", 2000, Element.Water, MonsterTypes.Wizzard);
            Card.Card Bcard4 = new MonsterCard("Mega Dragon", 2000, Element.Fire, MonsterTypes.Dragon);

            Deck DeckA = new Deck(Acard1, Acard2, Acard3, Acard4);
            Deck DeckB = new Deck(Bcard1, Bcard2, Bcard3, Bcard4);

            Assert.AreEqual(Acard1, DeckA._card1);
            Assert.AreEqual(Acard3, DeckA._card3);
            Assert.AreEqual(Bcard2, DeckB._card2);
            Assert.AreEqual(Acard4, DeckA._card4);
        }