Пример #1
0
        public async Task Deserialize()
        {
            _SkinsBodyData.Clear();
            _SkinsHandsData.Clear();
            _SkinsLegsData.Clear();
            _SkinsFeetData.Clear();
            _SkinsCharactersData.Clear();
            _SkinsItemsData.Clear();
            _SkinsStructuresData.Clear();
            _SkinsCrittersData.Clear();
            _SkinsSpecialData.Clear();
            _SkinsHallowedNightsSkinsData.Clear();
            _SkinsWintersFeastSkinsData.Clear();
            _SkinsYearOfTheGobblerSkinsData.Clear();
            _SkinsTheForgeData.Clear();
            _SkinsEmotesData.Clear();
            _SkinsOutfitSetsData.Clear();
            var Skins = JsonConvert.DeserializeObject <SkinsRootObject>(await StringProcess.GetJsonStringSkins());

            foreach (var SkinsBodyItems in Skins.Body.Skin)
            {
                SkinsBodyItems.Picture = StringProcess.GetGameResourcePath(SkinsBodyItems.Picture);
                SkinsBodyItems.Color   = GetSkinColor(SkinsBodyItems.Rarity);
                _SkinsBodyData.Add(SkinsBodyItems);
            }
            foreach (var SkinsHandsData in Skins.Hands.Skin)
            {
                SkinsHandsData.Picture = StringProcess.GetGameResourcePath(SkinsHandsData.Picture);
                SkinsHandsData.Color   = GetSkinColor(SkinsHandsData.Rarity);
                _SkinsHandsData.Add(SkinsHandsData);
            }
            foreach (var SkinsLegsItems in Skins.Legs.Skin)
            {
                SkinsLegsItems.Picture = StringProcess.GetGameResourcePath(SkinsLegsItems.Picture);
                SkinsLegsItems.Color   = GetSkinColor(SkinsLegsItems.Rarity);
                _SkinsLegsData.Add(SkinsLegsItems);
            }
            foreach (var SkinsFeetItems in Skins.Feet.Skin)
            {
                SkinsFeetItems.Picture = StringProcess.GetGameResourcePath(SkinsFeetItems.Picture);
                SkinsFeetItems.Color   = GetSkinColor(SkinsFeetItems.Rarity);
                _SkinsFeetData.Add(SkinsFeetItems);
            }
            foreach (var SkinsCharactersItems in Skins.Characters.Skin)
            {
                SkinsCharactersItems.Picture = StringProcess.GetGameResourcePath(SkinsCharactersItems.Picture);
                SkinsCharactersItems.Color   = GetSkinColor(SkinsCharactersItems.Rarity);
                _SkinsCharactersData.Add(SkinsCharactersItems);
            }
            foreach (var SkinsItemsItems in Skins.Items.Skin)
            {
                SkinsItemsItems.Picture = StringProcess.GetGameResourcePath(SkinsItemsItems.Picture);
                SkinsItemsItems.Color   = GetSkinColor(SkinsItemsItems.Rarity);
                _SkinsItemsData.Add(SkinsItemsItems);
            }
            foreach (var SkinsStructuresItems in Skins.Structures.Skin)
            {
                SkinsStructuresItems.Picture = StringProcess.GetGameResourcePath(SkinsStructuresItems.Picture);
                SkinsStructuresItems.Color   = GetSkinColor(SkinsStructuresItems.Rarity);
                _SkinsStructuresData.Add(SkinsStructuresItems);
            }
            foreach (var SkinsCrittersItems in Skins.Critters.Skin)
            {
                SkinsCrittersItems.Picture = StringProcess.GetGameResourcePath(SkinsCrittersItems.Picture);
                SkinsCrittersItems.Color   = GetSkinColor(SkinsCrittersItems.Rarity);
                _SkinsCrittersData.Add(SkinsCrittersItems);
            }
            foreach (var SkinsSpecialItems in Skins.Special.Skin)
            {
                SkinsSpecialItems.Picture = StringProcess.GetGameResourcePath(SkinsSpecialItems.Picture);
                SkinsSpecialItems.Color   = GetSkinColor(SkinsSpecialItems.Rarity);
                _SkinsSpecialData.Add(SkinsSpecialItems);
            }
            foreach (var SkinsHallowedNightsSkinsItems in Skins.HallowedNightsSkins.Skin)
            {
                SkinsHallowedNightsSkinsItems.Picture = StringProcess.GetGameResourcePath(SkinsHallowedNightsSkinsItems.Picture);
                SkinsHallowedNightsSkinsItems.Color   = GetSkinColor(SkinsHallowedNightsSkinsItems.Rarity);
                _SkinsHallowedNightsSkinsData.Add(SkinsHallowedNightsSkinsItems);
            }
            foreach (var SkinsWintersFeastSkinsItems in Skins.WintersFeastSkins.Skin)
            {
                SkinsWintersFeastSkinsItems.Picture = StringProcess.GetGameResourcePath(SkinsWintersFeastSkinsItems.Picture);
                SkinsWintersFeastSkinsItems.Color   = GetSkinColor(SkinsWintersFeastSkinsItems.Rarity);
                _SkinsWintersFeastSkinsData.Add(SkinsWintersFeastSkinsItems);
            }
            foreach (var SkinsYearOfTheGobblerSkinsItems in Skins.YearOfTheGobblerSkins.Skin)
            {
                SkinsYearOfTheGobblerSkinsItems.Picture = StringProcess.GetGameResourcePath(SkinsYearOfTheGobblerSkinsItems.Picture);
                SkinsYearOfTheGobblerSkinsItems.Color   = GetSkinColor(SkinsYearOfTheGobblerSkinsItems.Rarity);
                _SkinsYearOfTheGobblerSkinsData.Add(SkinsYearOfTheGobblerSkinsItems);
            }
            foreach (var SkinsTheForgeItems in Skins.TheForge.Skin)
            {
                SkinsTheForgeItems.Picture = StringProcess.GetGameResourcePath(SkinsTheForgeItems.Picture);
                SkinsTheForgeItems.Color   = GetSkinColor(SkinsTheForgeItems.Rarity);
                _SkinsTheForgeData.Add(SkinsTheForgeItems);
            }
            foreach (var SkinsEmotesItems in Skins.Emotes.Skin)
            {
                SkinsEmotesItems.Picture = StringProcess.GetGameResourcePath(SkinsEmotesItems.Picture);
                SkinsEmotesItems.Color   = GetSkinColor(SkinsEmotesItems.Rarity);
                _SkinsEmotesData.Add(SkinsEmotesItems);
            }
            foreach (var SkinsOutfitSetsItems in Skins.OutfitSets.Skin)
            {
                SkinsOutfitSetsItems.Picture = StringProcess.GetGameResourcePath(SkinsOutfitSetsItems.Picture);
                SkinsOutfitSetsItems.Color   = GetSkinColor(SkinsOutfitSetsItems.Rarity);
                _SkinsOutfitSetsData.Add(SkinsOutfitSetsItems);
            }
        }