コード例 #1
0
    public void participateInQuest_returnsFalse_canNotDiscard()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        iStrategyCPU2 strat   = new iStrategyCPU2();

        player1.hand.Add(new FoeCard("Foe Card", "Giant", "texture", 30, 30));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "texture", 5, 5));
        player1.hand.Add(new AllyCard("Ally Card", "Merlin", "Textures/Ally/merlin", 30, 30, "Player may preview any 1 stage per Quest", "", "", 0, 0, new NoBuff()));
        player1.hand.Add(new AllyCard("Ally Card", "Sir Percival", "Textures/Ally/sirPercival", 5, 0, "+ 20 on the Search for the Holy Grail Quest", "", "", 0, 0, new NoBuff()));
        player1.hand.Add(new AllyCard("Ally Card", "King Arthur", "Textures/Ally/kingArthur", 10, 0, "+ 2 Bids", "", "", 0, 0, new NoBuff()));
        player1.hand.Add(new WeaponCard("Weapon Card", "Excalibur", "texture", 30));
        player1.hand.Add(new WeaponCard("Weapon Card", "Horse", "texture", 10));
        player1.hand.Add(new WeaponCard("Weapon Card", "Horse", "texture", 10));

        Assert.AreEqual(strat.canIDiscard(player1.hand), false);
    }
コード例 #2
0
    public void playBid_returnsWithDuplicates_Round2()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        iStrategyCPU2 strat   = new iStrategyCPU2();

        player1.hand.Add(new FoeCard("Foe Card", "Saxons", "Textures/foe/saxons", 10, 20));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Losers", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Idiots", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Dummies", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Dummies", "Textures/foe/thieves", 5, 5));

        List <Card> cards = strat.playBid(player1.hand, 2);

        Assert.AreEqual(7, cards.Count);
    }
コード例 #3
0
    public void willIBid_returnsWithDuplicateInts_Round2()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        iStrategyCPU2 strat   = new iStrategyCPU2();

        player1.hand.Add(new FoeCard("Foe Card", "Saxons", "Textures/foe/saxons", 10, 20));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Losers", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Idiots", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Dummies", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "Textures/foe/thieves", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Dummies", "Textures/foe/thieves", 5, 5));

        int bid = strat.willIBid(3, player1.hand, 2, null);

        Assert.AreEqual(7, bid);
    }
コード例 #4
0
    public void playEarlyFoe_WithPreviousOf15_AmourIsTrue_OnlyAllies()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        List <Player> players = new List <Player>();
        iStrategyCPU2 strat   = new iStrategyCPU2();

        player1.hand.Add(new AmourCard("Amour Card", "Amour", "texture", 1, 10));
        player1.hand.Add(new AllyCard("Ally Card", "Sir Gaiwan", " ", 25, 25, "some effect", "None", "None", 0, 0, new NoBuff()));
        player1.hand.Add(new WeaponCard("Weapon Card", "Lance", " ", 5));
        player1.hand.Add(new WeaponCard("Weapon Card", "Scissors", " ", 5));
        player1.hand.Add(new WeaponCard("Weapon Card", "Excalibur", " ", 5));
        player1.hand.Add(new WeaponCard("Weapon Card", "Dagger", " ", 5));
        player1.hand.Add(new WeaponCard("Weapon Card", "Horse", " ", 5));
        players.Add(player1);

        List <Card> foeStage = strat.playEarlierFoe(player1.hand, 0, true, "", players);

        Assert.AreEqual(foeStage.Count, 1);
        Assert.AreEqual(foeStage[0].name, "Sir Gaiwan");
    }
コード例 #5
0
    public void playFirstFoeEncounter_WithAmour()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        List <Player> players = new List <Player>();
        iStrategyCPU2 strat   = new iStrategyCPU2();

        player1.hand.Add(new AmourCard("Amour Card", "Amour", "texture", 1, 10));
        player1.hand.Add(new AllyCard("Ally Card", "Sir Gaiwan", " ", 10, 0, "some effect", "None", "None", 0, 0, new NoBuff()));
        player1.hand.Add(new WeaponCard("Weapon Card", "Lance", " ", 20));
        player1.hand.Add(new WeaponCard("Weapon Card", "Excalibur", " ", 30));
        player1.hand.Add(new WeaponCard("Weapon Card", "Excalibur", " ", 30));
        player1.hand.Add(new WeaponCard("Weapon Card", "Dagger", " ", 5));
        player1.hand.Add(new WeaponCard("Weapon Card", "Horse", " ", 10));
        players.Add(player1);

        List <Card> foeStage = strat.playEarlierFoe(player1.hand, 0, false, "", players);

        Assert.AreEqual(foeStage.Count, 1);
        Assert.AreEqual(foeStage[0].name, "Amour");
    }
コード例 #6
0
    public void participateInQuest_returnsTrue_BothConditionsGood()
    {
        Player        player1 = new Player("Ahmed", new List <Card>(), new iStrategyCPU2());
        QuestCard     quest   = new QuestCard("Quest Card", "Journey through the Enchanted Forest", "Textures/Quests/journeyThroughTheEnchantedForest", 3, "Evil Knight");
        iStrategyCPU2 strat   = new iStrategyCPU2();
        List <Player> players = new List <Player>();

        player1.hand.Add(new AllyCard("Ally Card", "Merlin", "Textures/Ally/merlin", 10, 10, "Player may preview any 1 stage per Quest", "", "", 0, 0, new NoBuff()));
        player1.hand.Add(new AllyCard("Ally Card", "Sir Percival", "Textures/Ally/sirPercival", 5, 0, "+ 20 on the Search for the Holy Grail Quest", "", "", 0, 0, new NoBuff()));
        player1.hand.Add(new WeaponCard("Weapon Card", "Excalibur", "texture", 35));
        player1.hand.Add(new WeaponCard("Weapon Card", "Horse", "texture", 10));
        player1.hand.Add(new WeaponCard("Weapon Card", "Sword", "texture", 15));

        // player can discard so if they cant sponsor its because they cant increment
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "texture", 5, 5));
        player1.hand.Add(new FoeCard("Foe Card", "Thieves", "texture", 5, 5));
        players.Add(player1);

        Assert.AreEqual(true, strat.canIIncrement(3, player1.hand, players, quest));
    }