Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Station"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="src">The source.</param>
        /// <exception cref="System.ArgumentNullException">owner or src</exception>
        public Station(SolarSystem owner, SerializableStation src)
            : base(src?.Agents?.Count ?? 0)
        {
            owner.ThrowIfNull(nameof(owner));

            src.ThrowIfNull(nameof(src));

            ID                       = src.ID;
            Name                     = src.Name;
            CorporationID            = src.CorporationID;
            CorporationName          = src.CorporationName;
            SolarSystem              = owner;
            ReprocessingStationsTake = src.ReprocessingStationsTake;
            ReprocessingEfficiency   = src.ReprocessingEfficiency;
            FullLocation             = GetFullLocation(owner, src.Name);

            if (src.Agents == null)
            {
                return;
            }

            foreach (SerializableAgent agent in src.Agents)
            {
                Items.Add(new Agent(this, agent));
            }
        }