Ejemplo n.º 1
0
        public static ManaCost operator -(ManaCost x, ManaCost y)
        {
            var final = new ManaCost();

            var colorValues = (Color[])Enum.GetValues(typeof(Color));

            foreach (Color color in colorValues)
            {
                int countX = 0;
                int countY = 0;
                foreach (var mana in x.manaSymbols)
                {
                    if (mana.color == color)
                    {
                        countX++;
                    }
                }
                foreach (var mana in y.manaSymbols)
                {
                    if (mana.color == color)
                    {
                        countY++;
                    }
                }
                var finalCount = countX - countY;
                for (int i = 0; i < finalCount; i++)
                {
                    final.manaSymbols.Add(new ManaSymbol(color));
                }
            }
            return(final);
        }
Ejemplo n.º 2
0
 public void AddMana(ManaCost manaCost)
 {
     foreach (var mana in manaCost)
     {
         AddMana(mana);
     }
 }
Ejemplo n.º 3
0
        public static ManaCost operator +(ManaCost x, ManaCost y)
        {
            var allMana = new List <ManaSymbol>();

            allMana.AddRange(x.manaSymbols);
            allMana.AddRange(y.manaSymbols);

            var newManaCost = new ManaCost();

            newManaCost.manaSymbols.AddRange(allMana);
            return(newManaCost);
        }
Ejemplo n.º 4
0
        public static EventContainerPayManaCost Auto(ManaCost manaCost)
        {
            int count = 0;

            foreach (var mana in manaCost)
            {
                count++;
            }

            var list  = new PayManaCostEvent[count];
            int index = 0;

            foreach (var mana in manaCost)
            {
                list[index++] = new PayManaCostEvent(mana);
            }
            return(new EventContainerPayManaCost(list));
        }
Ejemplo n.º 5
0
 public static EventContainerAddMana Auto(OID source, int player, ManaCost mana)
 {
     return(Auto(source, player, mana.manaSymbols.ToArray()));
 }