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

CREST /industry/systems/ has a different format #13

Closed Zoriander closed 10 years ago

Zoriander commented 10 years ago

Hi,

not sure whether the CrestIndustrySystems.cs format was changed by CCP or not, however the one on git doesn#t work. I left the old code commented out in the following code to have a reference. The new one works as of right now:

using System.Collections.Generic;
using System.Runtime.Serialization;

namespace eZet.EveLib.Modules.Models
{
    /// <summary>
    /// Represents the response for Industry Systems in CREST
    /// </summary>
    [DataContract]
    public class CrestIndustrySystems : CrestCollectionResponse
    {
        [DataMember(Name = "items")]
        public List<SolarSystemEntry> SolarSystems { get; set; }

        [DataContract]
        public class SolarSystemEntry
        {

            /// <summary>
            /// The solar system
            /// </summary>
            [DataMember(Name = "solarSystem")]
            public CrestNamedEntity SolarSystem { get; set; }

            /// <summary>
            /// A list of system costs
            /// </summary>
            [DataMember(Name = "systemCostIndices")]
            public List<SystemCostEntry> SystemCostIndices { get; set; }
        }

        [DataContract]
        public class SystemCostEntry 
        {
            /// <summary>
            /// The cost index
            /// </summary>
            [DataMember(Name = "costIndex")]
            public decimal CostIndex { get; set; }

            /// <summary>
            /// The activity ID
            /// </summary>
            [DataMember(Name = "activityID")]
            public int ActivityId { get; set; }

            /// <summary>
            /// The activity name
            /// </summary>
            [DataMember(Name = "activityName")]
            public string ActivityName { get; set; }

        }

        /*
        /// <summary>
        /// The solar system
        /// </summary>
        [DataMember(Name = "solarSystem")]
        public List<SolarSystemEntry> SolarSystems { get; set; }

        /// <summary>
        /// Represesents a solar system for a SystemCostEntry
        /// </summary>
        [DataContract]
        public class SolarSystemEntry
        {

            /// <summary>
            /// The solar system
            /// </summary>
            public CrestNamedEntity SolarSystem { get; set; }

            /// <summary>
            /// A list of system costs
            /// </summary>
            public List<SystemCostEntry> SystemCostIndices { get; set; }

        }

        /// <summary>
        /// Represents a system cost index in CREST Industry Systems collection
        /// </summary>
        [DataContract]
        public class SystemCostEntry : CrestNamedEntity
        {
            /// <summary>
            /// The cost index
            /// </summary>
            [DataMember(Name = "costIndex")]
            public float CostIndex { get; set; }

            /// <summary>
            /// The activity ID
            /// </summary>
            [DataMember(Name = "activityID")]
            public int ActivityId { get; set; }

            /// <summary>
            /// The activity name
            /// </summary>
            [DataMember(Name = "activityName")]
            public string ActivityName { get; set; }

        }
         */
    }
}
ezet commented 10 years ago

Seems like I've been a bit too hasty with the implementation here. I'll add your fix tomorrow :)