示例#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);
        }
示例#2
0
 public static int GetConvertedCastCost(string castingCost)
 {
     return(Shard.GetShards(castingCost).Sum(shard => shard.ConvertedCastingCost));
 }
示例#3
0
 public static ShardColor GetColor(string castingCost)
 {
     return(Shard.GetShards(castingCost).Select(shard => shard.Color)
            .Aggregate(ShardColor.Colorless, (current, newColor) => current | newColor));
 }