示例#1
0
        public void GetItems_Test()
        {
            var items = api.GetItems(Region.euw, ItemData.all);

            Assert.IsNotNull(items.Items);
            Assert.IsTrue(items.Items.Count > 0);
        }
示例#2
0
        internal RealmStaticData(StaticRiotApi riotStaticApi, Realm realm, Region region)
        {
            Realm   = realm;
            Version = new RiotVersion(Realm.V);
            Region  = region;

            Champions      = riotStaticApi.GetChampions(region, ChampionData.all);
            Items          = riotStaticApi.GetItems(region, ItemData.all);
            SummonerSpells = riotStaticApi.GetSummonerSpells(region, SummonerSpellData.all);
        }
示例#3
0
        public static void UpdateItems()
        {
            var items   = STATIC_API.GetItems(NA);
            var allTags = items.Items.Values.SelectMany(i => i.Tags).ToArray();

            Array.Sort(allTags);

            items.Trees.SaveAs(ITEMS_PATH + "Trees.txt");
            items.Groups.SaveAs(ITEMS_PATH + "Groups.txt");

            var groupedByRequiredChampion     = new Dictionary <string, List <ItemStatic> >();
            List <ItemStatic> itemsNotSpecial = new List <ItemStatic>();

            foreach (var item in items.Items.Values)
            {
                bool notSpecial = true;
                item.Image.AddPath("Items");
                if (!String.IsNullOrWhiteSpace(item.RequiredChampion))
                {
                    if (groupedByRequiredChampion.ContainsKey(item.RequiredChampion))
                    {
                        groupedByRequiredChampion[item.RequiredChampion].Add(item);
                    }
                    else
                    {
                        groupedByRequiredChampion.Add(item.RequiredChampion, new List <ItemStatic>()
                        {
                            item
                        });
                    }
                    notSpecial = false;
                }
                if (item.Consumed)
                {
                    notSpecial = false;
                    item.SaveAs(ITEMS_PATH + @"Consumables\" + item.Id + ".txt");
                }
                if (item.Metadata.IsRune)
                {
                    notSpecial = false;
                    item.SaveAs(ITEMS_PATH + @"Runes\" + item.Id + ".txt");
                }
                if (!item.Maps["11"])
                {
                    notSpecial = false;
                    item.SaveAs(ITEMS_PATH + @"OtherMaps\" + item.Id + ".txt");
                }
                if (notSpecial && (item.HideFromAll || !item.InStore || !item.Gold.Purchasable))
                {
                    notSpecial = false;
                    item.SaveAs(ITEMS_PATH + @"MiscSpecial\" + item.Id + ".txt");
                }

                if (notSpecial)
                {
                    itemsNotSpecial.Add(item);
                    item.SaveAs(ITEMS_PATH + item.Id + ".txt");
                }
            }

            /*foreach(var item in itemsNotSpecial)
             * {
             *  if (!item.From.Any() && item)
             * }*/

            items = null;
        }