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