コード例 #1
0
        public void GetRoot()
        {
            CrestRoot root = crest.GetRoot();

            Debug.WriteLine(root.UserCounts.Dust);
            Debug.WriteLine(root.ServerName);
        }
コード例 #2
0
ファイル: EveCrest_Public_Tests.cs プロジェクト: ajni/evelib
        public void GetRoot()
        {
            CrestRoot root = crest.GetRoot();

            Debug.WriteLine(root.UserCounts.Dust);
            Debug.WriteLine(root.ServerName);
            //Debug.WriteLine(root.Regions.Uri);
            //var regionsData = crest.GetRoot().Query(f => f.Regions).Query(regions => regions.Items);
        }
コード例 #3
0
        public async Task AddAutopilotWaypoint()
        {
            var c      = await(await(await crest.GetRootAsync()).QueryAsync(r => r.Decode)).QueryAsync(r => r.Character);
            var wp     = c.Waypoints.Create();
            var system = crest.GetRoot().Query(r => r.Systems).Items.Single(s => s.Name == "Jita");

            wp.SolarSystem         = system;
            wp.First               = true;
            wp.ClearOtherWaypoints = true;
            Assert.IsTrue(await wp.SaveAsync());
        }
コード例 #4
0
        protected override void _ExecuteInConsole(IConsole console)
        {
            string retval = "";
            EveCrest crest = new EveCrest();

            var regions = crest.GetRoot().Query(r => r.Regions);
            var list = regions.Items.ToList();
            foreach (var region in list)
            {
                retval += region.Name;
                retval += "\n";
            }

            console.Write(retval);
        }
コード例 #5
0
        protected override void _ExecuteInConsole(IConsole console)
        {
            string   retval = "";
            EveCrest crest  = new EveCrest();

            var regions = crest.GetRoot().Query(r => r.Regions);
            var list    = regions.Items.ToList();

            foreach (var region in list)
            {
                retval += region.Name;
                retval += "\n";
            }

            console.Write(retval);
        }
コード例 #6
0
        public static void Main(string[] args)
        {
            // There are alternate views for things requiring a preamble.
            var crest = new EveCrest();
            var root = crest.GetRoot();

            // Note collections hold only the first 1000 or so items. To get an enumerable
            // over all, one might use the AllItems utility method.

            // The following is an illustration of one way to get the region ID for a given
            // named region.
            var regions = root.Query(r => r.Regions);
            const string regionName = "Deklein";
            var regionId = regions.AllItems().First(r => r.Name == regionName).Id;
            Console.WriteLine("Id for region '{0}' is {1}", regionName, regionId);

            // Now get the market type ID for generic small antimatter.
            var marketTypes = crest.Load(root.MarketTypes);
            const string itemName = "Antimatter Charge S";
            var itemId = marketTypes.AllItems().Select(i => i.Type).First(t => t.Name == itemName).Id;
            Console.WriteLine("Id for market item '{0}' is {1}", itemName, itemId);

            // The following call is deprecated as it is not idiomatic w.r.t. CREST, but it's
            // unclear to me what its replacement actually is.
            var hist = crest.GetMarketHistory(regionId, itemId);
            double monies = 0;
            long items = 0;
            foreach (var item in hist.AllItems())
            {
                monies += item.AvgPrice * item.Volume;
                items += item.Volume;
            }
            // These reports seem to span 13 total months.
            Console.WriteLine("Avg for '{0}' in '{1}' is {2} across {3} total ISK volume", itemName, regionName, monies / items, monies);

            // That's actually rather more than I expected. Who finds it effective to brawl with
            // antimatter charge S in nullsec, against the NPCs we often see here?
        }
コード例 #7
0
        public void GetRoot()
        {
            CrestRoot root = crest.GetRoot();

            Assert.AreEqual(EveCrest.DefaultAuthHost, root.CrestEndpoint.Uri);
        }
コード例 #8
0
 public async Task GetIcon()
 {
     var item = (await _crest.GetRoot().QueryAsync(r => r.MarketTypes)).Items.First();
     var icon = _crest.LoadImage(item.Type.Icon);
 }
コード例 #9
0
ファイル: EveCrest_Authed_Tests .cs プロジェクト: ajni/evelib
        public void CollectionPaging_Automatic()
        {
            IEnumerable <Alliance> result =
                crest.GetRoot().Query(r => r.Alliances).Query(r => r.Where(f => f.ShortName == "1"));

            Debug.WriteLine(result.FirstOrDefault());
        }
コード例 #10
0
 public async Task <MarketGroupCollection> GetMarketGroups()
 {
     return(await _crest.GetRoot().QueryAsync(r => r.MarketGroups).ConfigureAwait(false));
 }