Exemplo n.º 1
0
        private (int, int, int) GetWeightedCCM(ICardAllDbInfo cardAllDbInfo)
        {
            string castingCost = cardAllDbInfo.Card.CastingCost;

            if (MultiPartCardManager.Instance.HasMultiPart(cardAllDbInfo.Card) && cardAllDbInfo.CardPart2 != null)
            {
                castingCost += $" {cardAllDbInfo.CardPart2.CastingCost}";
            }
            int noGenerics = 0;
            int generics   = 0;
            int countXYZ   = 0;

            foreach (Shard shard in Shard.GetShards(castingCost))
            {
                if (shard.IsXYZ)
                {
                    countXYZ++;
                }
                else if (shard.IsGeneric)
                {
                    generics += shard.ConvertedCastingCost;
                }
                else
                {
                    noGenerics++;
                }
            }

            return(noGenerics, countXYZ, generics);
        }
Exemplo n.º 2
0
 public static int GetConvertedCastCost(string castingCost)
 {
     return(Shard.GetShards(castingCost).Sum(shard => shard.ConvertedCastingCost));
 }
Exemplo n.º 3
0
 public static ShardColor GetColor(string castingCost)
 {
     return(Shard.GetShards(castingCost).Select(shard => shard.Color)
            .Aggregate(ShardColor.Colorless, (current, newColor) => current | newColor));
 }