Пример #1
0
 internal void Add(ManaAmount newAmount)
 {
     amount.Add(newAmount);
 }
Пример #2
0
        public bool TrySubtract(ManaAmount amount)
        {
            if (!ContainsAtLeast(amount))
                return false;

            whiteAmount -= amount.whiteAmount;
            blueAmount -= amount.blueAmount;
            blackAmount -= amount.blackAmount;
            redAmount -= amount.redAmount;
            greenAmount -= amount.greenAmount;
            colorlessAmount -= amount.colorlessAmount;
            return true;
        }
Пример #3
0
 public void Add(ManaAmount amount)
 {
     whiteAmount += amount.whiteAmount;
     blueAmount += amount.blueAmount;
     blackAmount += amount.blackAmount;
     redAmount += amount.redAmount;
     greenAmount += amount.greenAmount;
     colorlessAmount += amount.colorlessAmount;
 }
Пример #4
0
 public bool ContainsAtLeast(ManaAmount amount)
 {
     return (whiteAmount >= amount.whiteAmount &&
         blueAmount >= amount.blueAmount &&
         blackAmount >= amount.blackAmount &&
         redAmount >= amount.redAmount &&
         greenAmount >= amount.greenAmount &&
         colorlessAmount >= amount.colorlessAmount);
 }