public void GetTotalManaCost() { var cost = new ManaCost(); cost.Mana.Add(ManaColor.Black, 2); cost.Mana.Add(ManaColor.Green, 2); Assert.AreEqual(4, cost.GetTotalManaCost()); }
public void CanCastSpellWithCost_2manaSpell_NoManaTapped() { var manacost = new ManaCost(); manacost.Mana.Add(ManaColor.Black, 2); bool result = manaPool.CanCastSpellWithCost(manacost); Assert.IsFalse(result); }
public bool CanCastSpellWithCost(ManaCost cost) { if (cost.GetTotalManaCost() > GetTotalNrOfManaAvailable()) return false; else if (!HasColoredManaAvailable(cost)) return false; return true; }
public void CanCastSpellWithCost_2manaSpell_2ManaAvailabvleOnColor() { var manacost = new ManaCost(); manacost.Mana.Add(ManaColor.Black, 2); manaPool.AddMana(ManaColor.Black, 2); bool result = manaPool.CanCastSpellWithCost(manacost); Assert.IsTrue(result); }
public void CanCastSpellWithCost_7manaSpell_HaveColoredButNotUncolored() { var manacost = new ManaCost(); manacost.Mana.Add(ManaColor.Black, 2); manacost.Mana.Add(ManaColor.Uncolored, 5); manaPool.AddMana(ManaColor.Black, 2); bool result = manaPool.CanCastSpellWithCost(manacost); Assert.IsFalse(result); }
private bool HasColoredManaAvailable(ManaCost cost) { var tmpMana = AvailableMana; foreach (var mana in cost.Mana) { if (mana.Key == ManaColor.Uncolored) continue; if (tmpMana[mana.Key] < mana.Value) return false; tmpMana[mana.Key] -= mana.Value; } return tmpMana.Values.Min() >= 0; }
public SpellCard() : base() { Cost = new ManaCost(); }
public void AddMana(ManaCost mana) { }