public ItemCostXml(
            [JsonProperty(PropertyName = "capitalresource", DefaultValueHandling = DefaultValueHandling.Ignore)]
            ItemCostCapitalResourceXml capitalResource,
            [JsonProperty(PropertyName = "gamecurrency", DefaultValueHandling = DefaultValueHandling.Ignore)]
            ItemCostGameCurrencyXml gameCurrency)
        {
            if (capitalResource == null && gameCurrency == null)
            {
                throw new ArgumentNullException();
            }

            if (capitalResource != null && gameCurrency != null)
            {
                throw new ArgumentOutOfRangeException();
            }

            CapitalResource = capitalResource;
            GameCurrency    = gameCurrency;
        }
 public ItemCostXml(CapitalResourceTypeEnum capitalResource, double quantity)
 {
     CapitalResource = new ItemCostCapitalResourceXml(capitalResource, quantity);
     GameCurrency    = null;
 }