Beispiel #1
0
 /// <summary>
 /// Updates this character with the given informations.
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="uri"></param>
 /// <param name="result"></param>
 internal void Update(CharacterIdentity identity, Uri uri, SerializableCCPCharacter result)
 {
     CharacterID = identity.CharacterID;
     Identity    = identity;
     m_uri       = uri;
     Import(result);
 }
Beispiel #2
0
 /// <summary>
 /// Updates this character with the given informations
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="uri"></param>
 /// <param name="result"></param>
 internal void Update(CharacterIdentity identity, Uri uri, CCPAPIResult <SerializableAPICharacterSheet> result)
 {
     CharacterID = identity.CharacterID;
     Identity    = identity;
     m_uri       = uri;
     Import(result);
 }
Beispiel #3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="identity">The identitiy for this character</param>
        /// <param name="guid">The unique identifier.</param>
        /// <exception cref="System.ArgumentNullException">identity</exception>
        protected Character(CharacterIdentity identity, Guid guid)
        {
            identity.ThrowIfNull(nameof(identity));

            CharacterID = identity.CharacterID;
            m_name = identity.CharacterName;
            CorporationID = identity.CorporationID;
            CorporationName = identity.CorporationName;

            Identity = identity;
            Guid = guid;

            Corporation = new Corporation(this);

            SkillGroups = new SkillGroupCollection(this);
            Skills = new SkillCollection(this);

            EmploymentHistory = new EmploymentRecordCollection(this);
            ImplantSets = new ImplantSetCollection(this);
            Plans = new PlanCollection(this);
            CertificateCategories = new CertificateCategoryCollection(this);
            CertificateClasses = new CertificateClassCollection(this);
            Certificates = new CertificateCollection(this);
            MasteryShips = new MasteryShipCollection(this);

            for (int i = 0; i < m_attributes.Length; i++)
            {
                m_attributes[i] = new CharacterAttribute(this, (EveAttribute)i);
            }

            UISettings = new CharacterUISettings();
        }
Beispiel #4
0
        /// <summary>
        /// Updates the characters list with the given CCP data.
        /// </summary>
        /// <param name="tokenInfo">The ESI token info from CCP.</param>
        private void ImportIdentities(EsiAPITokenInfo tokenInfo)
        {
            var  chars  = EveMonClient.CharacterIdentities.Where(id => id.ESIKeys.Contains(this));
            long charID = tokenInfo.CharacterID;

            // Clear the API key on this character
            foreach (CharacterIdentity id in chars)
            {
                id.ESIKeys.Remove(this);
            }

            // Find characters who own this ESI key
            // Can match at most one character
            CharacterIdentity cid = EveMonClient.CharacterIdentities[charID] ??
                                    EveMonClient.CharacterIdentities.Add(charID, tokenInfo.CharacterName);

            // Add the ESI key to the identity
            cid.ESIKeys.Add(this);
            if (cid.CCPCharacter != null)
            {
                // Notify subscribers
                EveMonClient.OnCharacterUpdated(cid.CCPCharacter);
            }

            // Fires the event regarding the character list update
            EveMonClient.OnCharacterListUpdated(this);
            EveMonClient.OnESIKeyCollectionChanged();
        }
Beispiel #5
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="identity">The identity for this character</param>
        /// <param name="guid">The unique identifier.</param>
        /// <exception cref="System.ArgumentNullException">identity</exception>
        protected Character(CharacterIdentity identity, Guid guid)
        {
            identity.ThrowIfNull(nameof(identity));

            CharacterID = identity.CharacterID;
            m_name      = identity.CharacterName;

            Identity = identity;
            Guid     = guid;

            Corporation = new Corporation(this);

            SkillGroups = new SkillGroupCollection(this);
            Skills      = new SkillCollection(this);

            UpdateAccountStatus();

            EmploymentHistory     = new EmploymentRecordCollection(this);
            ImplantSets           = new ImplantSetCollection(this);
            Plans                 = new PlanCollection(this);
            CertificateCategories = new CertificateCategoryCollection(this);
            CertificateClasses    = new CertificateClassCollection(this);
            Certificates          = new CertificateCollection(this);
            MasteryShips          = new MasteryShipCollection(this);

            for (int i = 0; i < m_attributes.Length; i++)
            {
                m_attributes[i] = new CharacterAttribute(this, (EveAttribute)i);
            }

            UISettings = new CharacterUISettings();
        }
Beispiel #6
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="guid"></param>
        private CCPCharacter(CharacterIdentity identity, Guid guid)
            : base(identity, guid)
        {
            QueryMonitors           = new QueryMonitorCollection();
            SkillQueue              = new SkillQueue(this);
            Standings               = new StandingCollection(this);
            Assets                  = new AssetCollection(this);
            WalletJournal           = new WalletJournalCollection(this);
            WalletTransactions      = new WalletTransactionsCollection(this);
            CharacterMarketOrders   = new MarketOrderCollection(this);
            CorporationMarketOrders = new MarketOrderCollection(this);
            CharacterContracts      = new ContractCollection(this);
            CorporationContracts    = new ContractCollection(this);
            CharacterIndustryJobs   = new IndustryJobCollection(this);
            CorporationIndustryJobs = new IndustryJobCollection(this);
            ResearchPoints          = new ResearchPointCollection(this);
            EVEMailMessages         = new EveMailMessageCollection(this);
            EVEMailingLists         = new EveMailingListCollection(this);
            EVENotifications        = new EveNotificationCollection(this);
            Contacts                = new ContactCollection(this);
            CharacterMedals         = new MedalCollection(this);
            CorporationMedals       = new MedalCollection(this);
            UpcomingCalendarEvents  = new UpcomingCalendarEventCollection(this);
            KillLog                 = new KillLogCollection(this);
            PlanetaryColonies       = new PlanetaryColonyCollection(this);
            LoyaltyPoints           = new LoyaltyCollection(this);

            m_endedOrdersForCharacter   = new List <MarketOrder>();
            m_endedOrdersForCorporation = new List <MarketOrder>();

            m_endedContractsForCharacter   = new List <Contract>();
            m_endedContractsForCorporation = new List <Contract>();

            m_jobsCompletedForCharacter = new List <IndustryJob>();
            m_allianceName    = EveIDToName.GetIDToName(AllianceID);
            m_corporationName = EveIDToName.GetIDToName(CorporationID);

            EveMonClient.CharacterAssetsUpdated           += EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated     += EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated   += EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated        += EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated      += EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated     += EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated   += EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted   += EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted  += EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.ESIKeyInfoUpdated  += EveMonClient_ESIKeyInfoUpdated;
            EveMonClient.EveIDToNameUpdated += EveMonClient_EveIDToNameUpdated;
            EveMonClient.TimerTick          += EveMonClient_TimerTick;
        }
Beispiel #7
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="guid"></param>
        private CCPCharacter(CharacterIdentity identity, Guid guid)
            : base(identity, guid)
        {
            QueryMonitors = new QueryMonitorCollection();
            SkillQueue = new SkillQueue(this);
            Standings = new StandingCollection(this);
            Assets = new AssetCollection(this);
            WalletJournal = new WalletJournalCollection(this);
            WalletTransactions = new WalletTransactionsCollection(this);
            CharacterMarketOrders = new MarketOrderCollection(this);
            CorporationMarketOrders = new MarketOrderCollection(this);
            CharacterContracts = new ContractCollection(this);
            CorporationContracts = new ContractCollection(this);
            CharacterContractBids = new ContractBidCollection(this);
            CorporationContractBids = new ContractBidCollection(this);
            CharacterIndustryJobs = new IndustryJobCollection(this);
            CorporationIndustryJobs = new IndustryJobCollection(this);
            ResearchPoints = new ResearchPointCollection(this);
            EVEMailMessages = new EveMailMessageCollection(this);
            EVEMailingLists = new EveMailingListCollection(this);
            EVENotifications = new EveNotificationCollection(this);
            Contacts = new ContactCollection(this);
            CharacterMedals = new MedalCollection(this);
            CorporationMedals = new MedalCollection(this);
            UpcomingCalendarEvents = new UpcomingCalendarEventCollection(this);
            KillLog = new KillLogCollection(this);
            PlanetaryColonies = new PlanetaryColonyCollection(this);

            m_endedOrdersForCharacter = new List<MarketOrder>();
            m_endedOrdersForCorporation = new List<MarketOrder>();

            m_endedContractsForCharacter = new List<Contract>();
            m_endedContractsForCorporation = new List<Contract>();

            m_jobsCompletedForCharacter = new List<IndustryJob>();

            EveMonClient.CharacterAssetsUpdated += EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated += EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated += EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated += EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated += EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated += EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated += EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted += EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted += EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.APIKeyInfoUpdated += EveMonClient_APIKeyInfoUpdated;
            EveMonClient.TimerTick += EveMonClient_TimerTick;
        }
Beispiel #8
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="serial"></param>
 internal UriCharacter(CharacterIdentity identity, SerializableUriCharacter serial)
     : base(identity, serial.Guid)
 {
     Import(serial);
 }
Beispiel #9
0
 /// <summary>
 /// Constructor for a new CCP character on a new identity.
 /// </summary>
 /// <param name="identity"></param>
 internal CCPCharacter(CharacterIdentity identity)
     : this(identity, Guid.NewGuid())
 {
     ForceUpdateBasicFeatures = true;
     m_lastAPIUpdates = new List<SerializableAPIUpdate>();
 }
Beispiel #10
0
 /// <summary>
 /// Default constructor for new uri characters.
 /// </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="source">A deserialization object for characters</param>
 internal UriCharacter(CharacterIdentity identity, Uri uri, CCPAPIResult<SerializableAPICharacterSheet> source)
     : base(identity, Guid.NewGuid())
 {
     m_uri = uri;
     Import(source);
 }
Beispiel #11
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 #12
0
 /// <summary>
 /// Updates this character with the given informations
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="uri"></param>
 /// <param name="result"></param>
 internal void Update(CharacterIdentity identity, Uri uri, CCPAPIResult<SerializableAPICharacterSheet> result)
 {
     CharacterID = identity.CharacterID;
     Identity = identity;
     m_uri = uri;
     Import(result);
 }
Beispiel #13
0
 /// <summary>
 /// Updates this character with the given informations.
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="uri"></param>
 /// <param name="result"></param>
 internal void Update(CharacterIdentity identity, Uri uri, SerializableCCPCharacter result)
 {
     CharacterID = identity.CharacterID;
     Identity = identity;
     m_uri = uri;
     Import(result);
 }
Beispiel #14
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="identity">The identity for this character</param>
 /// <param name="serial">A deserialization object for characters</param>
 internal CCPCharacter(CharacterIdentity identity, SerializableCCPCharacter serial)
     : this(identity, serial.Guid)
 {
     Import(serial);
     m_lastAPIUpdates = serial.LastUpdates.ToList();
 }
Beispiel #15
0
 /// <summary>
 /// Constructor for a new CCP character on a new identity.
 /// </summary>
 /// <param name="identity"></param>
 internal CCPCharacter(CharacterIdentity identity)
     : this(identity, Guid.NewGuid())
 {
     ForceUpdateBasicFeatures = true;
     m_lastAPIUpdates         = new List <SerializableAPIUpdate>();
 }
Beispiel #16
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="identity">The identity for this character</param>
 /// <param name="serial">A deserialization object for characters</param>
 internal CCPCharacter(CharacterIdentity identity, SerializableCCPCharacter serial)
     : this(identity, serial.Guid)
 {
     Import(serial);
     m_lastAPIUpdates = serial.LastUpdates.ToList();
 }
Beispiel #17
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="identity"></param>
 public CharacterIdentityChangedEventArgs(CharacterIdentity identity)
 {
     CharacterIdentity = identity;
 }
Beispiel #18
0
 /// <summary>
 /// Default constructor for new uri characters.
 /// </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="source">A deserialization object for characters</param>
 internal UriCharacter(CharacterIdentity identity, Uri uri, CCPAPIResult <SerializableAPICharacterSheet> source)
     : base(identity, Guid.NewGuid())
 {
     m_uri = uri;
     Import(source);
 }
Beispiel #19
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="serial"></param>
 internal UriCharacter(CharacterIdentity identity, SerializableUriCharacter serial)
     : base(identity, serial.Guid)
 {
     Import(serial);
 }
Beispiel #20
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);
 }