Esempio n. 1
0
 /// <summary>
 /// Imports data from an API serialization object
 /// </summary>
 /// <param name="serial"></param>
 /// <param name="overrideManual"></param>
 internal void Import(SerializableAPIImplantSet serial)
 {
     Import(ImplantSlots.Intelligence, serial.Intelligence);
     Import(ImplantSlots.Perception, serial.Perception);
     Import(ImplantSlots.Willpower, serial.Willpower);
     Import(ImplantSlots.Charisma, serial.Charisma);
     Import(ImplantSlots.Memory, serial.Memory);
 }
Esempio n. 2
0
        /// <summary>
        /// Imports data from an API serialization object provided by CCP
        /// </summary>
        /// <param name="serial"></param>
        internal void Import(SerializableAPIImplantSet serial)
        {
            // Search whether the api infos are different from the ones currently stored.
            var newSet = new ImplantSet(m_owner, "temp");

            newSet.Import(serial);

            bool isDifferent = false;
            var  oldArray    = m_api.ToArray();
            var  newArray    = newSet.ToArray();

            for (int i = 0; i < oldArray.Length; i++)
            {
                isDifferent |= (oldArray[i] != newArray[i]);
            }

            // Imports the API and make a backup
            if (isDifferent)
            {
                m_oldAPI.Import(m_api.Export(), false);
            }
            m_api.Import(serial);
        }