public static CardModel From(Card card) { return card == null ? null : new CardModel { Name = card.Name, Cost = card.Cost, Gold = card.Gold, Health = card.Health, Id = card.Id, Level = card.Level, Light = card.Light, Darkness = card.Darkness, MagicAttack = card.MagicAttack, PhysicalAttack = card.PhysicalAttack, PotentialMagicAttack = card.PotentialMagicAttack == null ? null : card.PotentialMagicAttack(), PotentialPhysicalAttack = card.PotentialPhysicalAttack == null ? null : card.PotentialPhysicalAttack(), Rank = card.Rank == null ? (int?) null : card.Rank.Number, Strength = card.Strength, Tags = card.Tags, Text = card.Text, Type = card.Type.ToString(), Vp = card.Vp, Xp = card.Xp, Owner = card.Owner.ToString(), Equipped = card.IsEquipped ? card.GetEquipped().Select(c=>c.Name).ToArray() : null }; }