ezet / evelib

Eve Online Library.NET is an open source C# wrapper for CCPs Eve Online API and other popular Eve Online APIs.
Apache License 2.0
71 stars 36 forks source link

Industry Team Workers #23

Closed dimaman2001 closed 9 years ago

dimaman2001 commented 9 years ago

The Worker Bonus value is always set to ME even if the worker is providing a TE bonus

dimaman2001 commented 9 years ago

Solution:

Set EnumMember attributes to the Enum

    public enum BonusType
    {
        /// <summary>
        ///     Material Efficency Bonus
        /// </summary>
        [EnumMember(Value = "ME")]
        ME,

        /// <summary>
        ///     Production Efficiency Bonus
        /// </summary>
        [EnumMember(Value = "TE")]
        TE
    }

Add the JsonConverter and use the JsonProperty attributes to the property:

        [JsonProperty("bonusType")]
        [JsonConverter(typeof(StringEnumConverter))]
        public BonusType Type { get; set; }
ezet commented 9 years ago

Feel free to fix what you can and issue a pull request. Else I'll have a look at it tomorrow if I get time.