Пример #1
0
 private int GetColorIndex(SingleColorManaAmount manaOfSingleColor)
 {
     return(manaOfSingleColor.Color.IsColorless
 ? 5
            // amount never contains mana whish is multiple colors at the same time
 : manaOfSingleColor.Color.Indices[0]);
 }
Пример #2
0
        public MultiColorManaAmount(Dictionary <ManaColor, int> colorCounts)
        {
            SingleColorManaAmount colorless = null;

            _generic = 0;

            foreach (var colorCount in colorCounts)
            {
                var singleColor = new SingleColorManaAmount(colorCount.Key, colorCount.Value);
                _converted += colorCount.Value;

                if (singleColor.Color.IsColorless)
                {
                    colorless = singleColor;

                    _generic += colorless.Count;

                    continue;
                }

                _groups.Add(singleColor);
            }

            if (colorless != null)
            {
                _groups.Add(colorless);
            }
        }
Пример #3
0
        public MultiColorManaAmount(Dictionary<ManaColor, int> colorCounts)
        {
            SingleColorManaAmount colorless = null;

              foreach (var colorCount in colorCounts)
              {
            var singleColor = new SingleColorManaAmount(colorCount.Key, colorCount.Value);
            Converted += colorCount.Value;

            if (singleColor.Color.IsColorless)
            {
              colorless = singleColor;
              continue;
            }

            _groups.Add(singleColor);
              }

              if (colorless != null)
              {
            _groups.Add(colorless);
              }
        }