Beispiel #1
0
        /// <summary>
        /// Imports data from the given character sheet informations
        /// </summary>
        /// <param name="serial">The serialized character sheet</param>
        protected void Import(SerializableSettingsCharacter serial)
        {
            Import((SerializableCharacterSheetBase)serial);

            // Implants
            m_implants.Import(serial.ImplantSets);
        }
Beispiel #2
0
        /// <summary>
        /// Fetches the data to the given serialization object, used by inheritors.
        /// </summary>
        /// <param name="ci"></param>
        protected void Export(SerializableSettingsCharacter serial)
        {
            serial.Guid = m_guid;
            serial.ID = m_identity.CharacterID;
            serial.Name = m_name;
            serial.Birthday = m_birthday;
            serial.Race = m_race;
            serial.Ancestry = m_ancestry;
            serial.Gender = m_gender;
            serial.BloodLine = m_bloodLine;
            serial.CorporationName = m_corporationName;
            serial.CorporationID = m_corporationID;
            serial.AllianceName = m_allianceName;
            serial.AllianceID = m_allianceID;
            serial.CloneSkillPoints = m_cloneSkillPoints;
            serial.CloneName = m_cloneName;
            serial.Balance = m_balance;

            // Attributes
            serial.Attributes.Intelligence = Intelligence.Base;
            serial.Attributes.Perception = Perception.Base;
            serial.Attributes.Willpower = Willpower.Base;
            serial.Attributes.Charisma = Charisma.Base;
            serial.Attributes.Memory = Memory.Base;

            // Implants sets
            serial.ImplantSets = ImplantSets.Export();

            // Certificates
            serial.Certificates = new List<SerializableCharacterCertificate>();
            foreach(var cert in Certificates.Where(x => x.IsGranted))
            {
                serial.Certificates.Add(new SerializableCharacterCertificate{ CertificateID = cert.ID });
            }

            // Skills
            serial.Skills = new List<SerializableCharacterSkill>();
            foreach(var skill in Skills.Where(x => x.IsKnown || x.IsOwned))
            {
                serial.Skills.Add(skill.Export());
            }
        }
Beispiel #3
0
        /// <summary>
        /// Imports data from the given character sheet informations.
        /// </summary>
        /// <param name="serial">The serialized character sheet</param>
        /// <exception cref="System.ArgumentNullException">serial</exception>
        protected void Import(SerializableSettingsCharacter serial)
        {
            serial.ThrowIfNull(nameof(serial));

            Import((SerializableCharacterSheetBase)serial);

            // Implants
            ImplantSets.Import(serial.ImplantSets);
        }
Beispiel #4
0
 /// <summary>
 /// Exported character constructor.
 /// </summary>
 /// <param name="identity">The identitiy for this character</param>
 /// <param name="uri">The uri the provided deserialization object was acquired from</param>
 /// <param name="serial">The serial.</param>
 internal UriCharacter(CharacterIdentity identity, Uri uri, SerializableSettingsCharacter serial)
     : base(identity, Guid.NewGuid())
 {
     m_uri = uri;
     Import(serial);
 }
Beispiel #5
0
        /// <summary>
        /// Fetches the data to the given serialization object, used by inheritors.
        /// </summary>
        /// <param name="serial">The serial.</param>
        /// <exception cref="System.ArgumentNullException">serial</exception>
        protected void Export(SerializableSettingsCharacter serial)
        {
            serial.ThrowIfNull(nameof(serial));

            serial.Guid = Guid;
            serial.ID = Identity.CharacterID;
            serial.Name = m_name;
            serial.HomeStationID = HomeStationID;
            serial.Birthday = Birthday;
            serial.Race = Race;
            serial.BloodLine = Bloodline;
            serial.Ancestry = Ancestry;
            serial.Gender = Gender;
            serial.CorporationName = CorporationName;
            serial.CorporationID = CorporationID;
            serial.AllianceName = AllianceName;
            serial.AllianceID = AllianceID;
            serial.FreeSkillPoints = FreeSkillPoints;
            serial.FreeRespecs = AvailableReMaps;
            serial.CloneJumpDate = JumpCloneLastJumpDate;
            serial.LastRespecDate = LastReMapDate;
            serial.LastTimedRespec = LastReMapTimed;
            serial.RemoteStationDate = RemoteStationDate;
            serial.JumpActivationDate = JumpActivationDate;
            serial.JumpFatigueDate = JumpFatigueDate;
            serial.JumpLastUpdateDate = JumpLastUpdateDate;
            serial.Balance = Balance;

            // Info
            serial.ShipName = ShipName;
            serial.ShipTypeName = ShipTypeName;
            serial.SecurityStatus = SecurityStatus;
            serial.LastKnownLocation = LastKnownLocation;

            // Employment History
            serial.EmploymentHistory.AddRange(EmploymentHistory.Export());

            // Attributes
            serial.Attributes.Intelligence = Intelligence.Base;
            serial.Attributes.Perception = Perception.Base;
            serial.Attributes.Willpower = Willpower.Base;
            serial.Attributes.Charisma = Charisma.Base;
            serial.Attributes.Memory = Memory.Base;

            // Implants sets
            serial.ImplantSets = ImplantSets.Export();

            // Skills
            serial.Skills.AddRange(Skills.Export());
        }