コード例 #1
0
 /// <summary>
 /// Constructor for CCP Characters
 /// </summary>
 /// <param name="uri">URI of the character</param>
 /// <param name="result">Serialized Result</param>
 public UriCharacterEventArgs(Uri uri, SerializableCCPCharacter result)
 {
     m_uri    = uri;
     m_result = result;
     HasError = false;
     Error    = String.Empty;
 }
コード例 #2
0
 /// <summary>
 /// Constructor for API Characters
 /// </summary>
 /// <param name="uri">URI of the character</param>
 /// <param name="result">API Result</param>
 public UriCharacterEventArgs(Uri uri, APIResult <SerializableAPICharacter> result)
 {
     m_uri       = uri;
     m_apiResult = result;
     m_result    = m_apiResult.Result;
     HasError    = m_apiResult.HasError;
     Error       = m_apiResult.ErrorMessage;
 }
コード例 #3
0
        private CharacterIdentity GetIdentity(SerializableCharacterBase character)
        {
            // Retrieve the identity and create one if needed
            var identity = EveClient.CharacterIdentities[character.ID];

            if (identity == null)
            {
                identity = EveClient.CharacterIdentities.Add(character.ID, character.Name);
            }
            return(identity);
        }
コード例 #4
0
ファイル: Character.cs プロジェクト: Almamu/evemon
        /// <summary>
        /// Imports data from the given character sheet informations
        /// </summary>
        /// <param name="serial">The serialized character sheet</param>
        protected void Import(SerializableCharacterBase serial)
        {
            bool fromCCP = (serial is SerializableAPICharacter);

            // Bio
            m_name             = serial.Name;
            m_race             = serial.Race;
            m_gender           = serial.Gender;
            m_balance          = serial.Balance;
            m_bloodLine        = serial.BloodLine;
            m_corporationName  = serial.CorporationName;
            m_cloneName        = serial.CloneName;
            m_cloneSkillPoints = serial.CloneSkillPoints;

            // Attributes
            m_attributes[(int)EveAttribute.Intelligence].Base = serial.Attributes.Intelligence;
            m_attributes[(int)EveAttribute.Perception].Base   = serial.Attributes.Perception;
            m_attributes[(int)EveAttribute.Willpower].Base    = serial.Attributes.Willpower;
            m_attributes[(int)EveAttribute.Charisma].Base     = serial.Attributes.Charisma;
            m_attributes[(int)EveAttribute.Memory].Base       = serial.Attributes.Memory;

            // Skills : reset all > update all
            foreach (var skill in m_skills)
            {
                skill.Reset(fromCCP);
            }
            foreach (var serialSkill in serial.Skills)
            {
                // Take care of the new skills not in our datafiles yet. Update if it exists.
                var foundSkill = m_skills[serialSkill.ID];
                if (foundSkill != null)
                {
                    foundSkill.Import(serialSkill, fromCCP);
                }
            }

            // Certificates : reset > mark the granted ones > update the other ones
            foreach (var cert in m_certificates)
            {
                cert.Reset();
            }
            foreach (var serialCert in serial.Certificates)
            {
                // Take care of the new certs not in our datafiles yet. Mark as granted if it exists.
                var foundCert = m_certificates[serialCert.CertificateID];
                if (foundCert != null)
                {
                    foundCert.MarkAsGranted();
                }
            }

            while (true)
            {
                bool updatedAnything = false;
                foreach (var cert in m_certificates)
                {
                    updatedAnything |= cert.TryUpdateCertificateStatus();
                }
                if (!updatedAnything)
                {
                    break;
                }
            }

            // Not from CCP ?
            if (!fromCCP)
            {
                SerializableSettingsCharacter nonCCPSerial = (SerializableSettingsCharacter)serial;
            }
        }