コード例 #1
0
        public void GetCorporationSheet()
        {
            ResponseCache.Clear();
            CorporationSheet cs = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            testCorporationSheet(cs);

            ResponseCache.Clear();
            CorporationSheet cs2 = EveApi.GetCorporationSheet(432435, 234523, "apiKey", 2345);

            testCorporationSheet(cs2);
        }
コード例 #2
0
        public void CorporationSheetPersist()
        {
            ResponseCache.Clear();
            CorporationSheet cs = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            ResponseCache.Save("ResponseCache.xml");
            ResponseCache.Clear();
            ResponseCache.Load("ResponseCache.xml");
            CorporationSheet cached = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            Assert.AreEqual(cs.CachedUntilLocal, cached.CachedUntilLocal);

            Assert.AreEqual(cs.CorporationId, cached.CorporationId);
            Assert.AreEqual(cs.CorporationName, cached.CorporationName);
            Assert.AreEqual(cs.Ticker, cached.Ticker);
            Assert.AreEqual(cs.CeoId, cached.CeoId);
            Assert.AreEqual(cs.CeoName, cached.CeoName);
            Assert.AreEqual(cs.StationId, cached.StationId);
            Assert.AreEqual(cs.StationName, cached.StationName);
            Assert.AreEqual(cs.Description, cached.Description);
            Assert.AreEqual(cs.Url, cached.Url);
            Assert.AreEqual(cs.AllianceId, cached.AllianceId);
            Assert.AreEqual(cs.AllianceName, cached.AllianceName);
            Assert.AreEqual(cs.TaxRate, cached.TaxRate);
            Assert.AreEqual(cs.MemberCount, cached.MemberCount);
            Assert.AreEqual(cs.MemberLimit, cached.MemberLimit);
            Assert.AreEqual(cs.Shares, cached.Shares);

            for (int i = 0; i < cs.Divisions.Length; i++)
            {
                Assert.AreEqual(cs.Divisions[i].AccountKey, cached.Divisions[i].AccountKey);
                Assert.AreEqual(cs.Divisions[i].Description, cached.Divisions[i].Description);
            }

            for (int i = 0; i < cs.WalletDivisions.Length; i++)
            {
                Assert.AreEqual(cs.WalletDivisions[i].AccountKey, cached.WalletDivisions[i].AccountKey);
                Assert.AreEqual(cs.WalletDivisions[i].Description, cached.WalletDivisions[i].Description);
            }

            Assert.AreEqual(cs.Logo.GraphicId, cached.Logo.GraphicId);
            Assert.AreEqual(cs.Logo.Shape1, cached.Logo.Shape1);
            Assert.AreEqual(cs.Logo.Shape2, cached.Logo.Shape2);
            Assert.AreEqual(cs.Logo.Shape3, cached.Logo.Shape3);
            Assert.AreEqual(cs.Logo.Color1, cached.Logo.Color1);
            Assert.AreEqual(cs.Logo.Color2, cached.Logo.Color2);
            Assert.AreEqual(cs.Logo.Color3, cached.Logo.Color3);
        }
コード例 #3
0
ファイル: Examples.cs プロジェクト: Lugghawk/libeveapi
        public static void CorporationSheetExample()
        {
            CorporationSheet corporationSheet = EveApi.GetCorporationSheet(452453, 452452, "apiKey");

            Console.WriteLine("Corporation Name: {0} Ticker: {1}", corporationSheet.CorporationName, corporationSheet.Ticker);
            Console.WriteLine("Logo GraphicId: {0}", corporationSheet.Logo.GraphicId);

            foreach (CorporationSheet.Division division in corporationSheet.Divisions)
            {
                Console.WriteLine("Division AccountKey: {0} Description: {1}", division.AccountKey, division.Description);
            }

            foreach (CorporationSheet.WalletDivision walletDivision in corporationSheet.WalletDivisions)
            {
                Console.WriteLine("Wallet Division AccountKey: {0} Description: {1}", walletDivision.AccountKey, walletDivision.Description);
            }
        }
コード例 #4
0
        private Dictionary <string, List <IndustryJobList.IndustryJobListItem> > getCorpsJobsForUser(User user)
        {
            Iesi.Collections.Generic.ISet <UserApi> apis = user.apis;


            Dictionary <string, List <IndustryJobList.IndustryJobListItem> > corpJobs = new Dictionary <string, List <IndustryJobList.IndustryJobListItem> >();

            foreach (UserApi api in apis)
            {
                foreach (Character character in api.characters)
                {
                    try
                    {
                        List <IndustryJobList.IndustryJobListItem> industryJobs = new List <IndustryJobList.IndustryJobListItem>();
                        String corp = EveApi.GetCorporationSheet(api.apiUserId, character.apiCharacterId, api.apiKeyId).CorporationName;
                        if (corpJobs.ContainsKey(corp))
                        {
                            continue;
                        }
                        IndustryJobList jobs = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, api.apiUserId, character.apiCharacterId, api.apiKeyId);
                        foreach (IndustryJobList.IndustryJobListItem job in jobs.IndustryJobListItems)
                        {
                            if (job.EndProductionTimeLocal > DateTime.Now)
                            {
                                industryJobs.Add(job);
                            }
                        }

                        corpJobs.Add(corp, industryJobs);
                    }
                    catch (System.Net.WebException webException)
                    {
                        //Probably a 403, but we should refine this a bit.
                        log.Debug("Got a" + webException.GetType().ToString() + " when trying to get " + character.characterName + "'s corp job sheet.");
                    }
                    catch (Exception e)
                    {
                        log.Warn(e);
                    }
                }
            }
            return(corpJobs);
        }
コード例 #5
0
        private static CorporationSheet GetCorpDetails()
        {
            EveApi API = new EveApi("Clyde en Marland's KillBot", Properties.Settings.Default.CorpAPI, Properties.Settings.Default.VCode);

            return API.GetCorporationSheet();
        }
コード例 #6
0
        private static CorporationSheet GetCorpDetails()
        {
            EveApi API = new EveApi("Clyde en Marland's KillBot", Properties.Settings.Default.CorpAPI, Properties.Settings.Default.VCode);

            return(API.GetCorporationSheet());
        }