Esempio n. 1
0
        /// <summary>
        /// Imports data from an ESI deserialization object.
        /// </summary>
        public void Import(EsiAPIClones serial)
        {
            if (serial == null)
            {
                return;
            }

            m_cloneSets.Clear();
            // Jump clones
            foreach (var clone in serial.JumpClones)
            {
                int cloneID = clone.JumpCloneID;
                var set     = new ImplantSet(m_character, GetCloneName(clone.Name, clone.
                                                                       LocationID));
                // Jump clone implants
                var jcImplants = new LinkedList <SerializableNewImplant>();
                foreach (int implant in clone.Implants)
                {
                    jcImplants.AddLast(new SerializableNewImplant()
                    {
                        ID   = implant,
                        Name = StaticItems.GetItemName(implant)
                    });
                }
                set.Import(jcImplants);
                m_cloneSets.Add(set);
            }

            EveMonClient.OnCharacterImplantSetCollectionChanged(m_character);
        }
Esempio n. 2
0
 /// <summary>
 /// Imports data from the given character clone information.
 /// </summary>
 /// <param name="clones">The serialized character clone information</param>
 internal void Import(EsiAPIClones clones)
 {
     // Information about clone jumping and clone moving
     JumpCloneLastJumpDate = clones.LastCloneJump;
     RemoteStationDate     = clones.LastStationChange;
     HomeStationID         = clones.HomeLocation.LocationID;
     ImplantSets.Import(clones);
 }
Esempio n. 3
0
        /// <summary>
        /// Processes the queried character's clones.
        /// </summary>
        /// <param name="result"></param>
        private void OnCharacterClonesUpdated(EsiAPIClones result)
        {
            var target = m_ccpCharacter;

            // Character may have been deleted since we queried
            if (target != null)
            {
                target.Import(result);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Imports data from the given character clone information.
        /// </summary>
        /// <param name="clones">The serialized character clone information</param>
        internal void Import(EsiAPIClones clones)
        {
            var newClones = new SerializableImplantSetCollection();

            // Information about clone jumping and clone moving
            JumpCloneLastJumpDate = clones.LastCloneJump;
            RemoteStationDate     = clones.LastStationChange;
            HomeStationID         = clones.HomeLocation.LocationID;
            ImplantSets.Import(newClones);
        }
Esempio n. 5
0
        /// <summary>
        /// Processes the queried character's clones.
        /// </summary>
        /// <param name="result"></param>
        private void OnCharacterClonesUpdated(EsiAPIClones result)
        {
            var target = m_ccpCharacter;

            // Character may have been deleted since we queried
            if (target != null)
            {
                target.Import(result);
                QueryCharacterData <EsiAPIAttributes>(ESIAPICharacterMethods.Attributes,
                                                      EveMonClient.Notifications.NotifyCharacterAttributesError,
                                                      OnCharacterAttributesUpdated);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Imports data from an ESI deserialization object.
        /// </summary>
        public void Import(EsiAPIClones serial)
        {
            if (serial == null)
            {
                return;
            }

            m_cloneSets.Clear();
            // Jump clones
            foreach (var clone in serial.JumpClones)
            {
                int    cloneID = clone.JumpCloneID;
                string name    = clone.Name;
                // Try to pick a sane name if it is null
                if (string.IsNullOrEmpty(name))
                {
                    var location = EveIDToStation.GetIDToStation(clone.LocationID);
                    if (location == null)
                    {
                        name = "Clone at location #" + clone.LocationID.ToString(CultureInfo.
                                                                                 InvariantCulture);
                    }
                    else
                    {
                        name = "Clone in " + location.Name;
                    }
                }
                ImplantSet set = new ImplantSet(m_character, name);
                // Jump clone implants
                var jcImplants = new LinkedList <SerializableNewImplant>();
                foreach (int implant in clone.Implants)
                {
                    jcImplants.AddLast(new SerializableNewImplant()
                    {
                        ID   = implant,
                        Name = StaticItems.GetItemName(implant)
                    });
                }
                set.Import(jcImplants);
                m_cloneSets.Add(set);
            }

            EveMonClient.OnCharacterImplantSetCollectionChanged(m_character);
        }