public async Task Deserialize() { _naturalBiomesData.Clear(); var natural = JsonConvert.DeserializeObject <NaturalRootObject>(await StringProcess.GetJsonString("Natural.json")); foreach (var natureBiomesItems in natural.Biomes.NatureBiomes) { natureBiomesItems.Picture = StringProcess.GetGameResourcePath(natureBiomesItems.Picture); _naturalBiomesData.Add(natureBiomesItems); } foreach (var natureSmallPlantItems in natural.SmallPlants.NatureSmallPlant) { natureSmallPlantItems.Picture = StringProcess.GetGameResourcePath(natureSmallPlantItems.Picture); _naturalSmallPlantData.Add(natureSmallPlantItems); } foreach (var natureTreesItems in natural.Trees.NatureTree) { natureTreesItems.Picture = StringProcess.GetGameResourcePath(natureTreesItems.Picture); _naturalTreesData.Add(natureTreesItems); } foreach (var natureCreatureNestItems in natural.CreatureNests.NatureCreatureNest) { natureCreatureNestItems.Picture = StringProcess.GetGameResourcePath(natureCreatureNestItems.Picture); _naturalCreatureNestData.Add(natureCreatureNestItems); } }
public async void Deserialize() { var food = JsonConvert.DeserializeObject <FoodRootObject>(await StringProcess.GetJsonString("Foods.json")); foreach (var foodRecipeItems in food.FoodRecipe.FoodRecipes) { _foodRecipeData.Add(foodRecipeItems); } foreach (var foodMeatsItems in food.FoodMeats.Foods) { _foodMeatData.Add(foodMeatsItems); } foreach (var foodMeatsItems in _foodMeatData) { foodMeatsItems.Picture = StringProcess.GetGameResourcePath(foodMeatsItems.Picture); } foreach (var foodVegetablesItems in food.FoodVegetables.Foods) { _foodVegetableData.Add(foodVegetablesItems); } foreach (var foodVegetablesItems in _foodVegetableData) { foodVegetablesItems.Picture = StringProcess.GetGameResourcePath(foodVegetablesItems.Picture); } foreach (var foodFruitItems in food.FoodFruit.Foods) { _foodFruitData.Add(foodFruitItems); } foreach (var foodFruitItems in _foodFruitData) { foodFruitItems.Picture = StringProcess.GetGameResourcePath(foodFruitItems.Picture); } foreach (var foodEggsItems in food.FoodEggs.Foods) { _foodEggData.Add(foodEggsItems); } foreach (var foodEggsItems in _foodEggData) { foodEggsItems.Picture = StringProcess.GetGameResourcePath(foodEggsItems.Picture); } foreach (var foodOthersItems in food.FoodOthers.Foods) { _foodOtherData.Add(foodOthersItems); } foreach (var foodOthersItems in _foodOtherData) { foodOthersItems.Picture = StringProcess.GetGameResourcePath(foodOthersItems.Picture); } }
public async Task Deserialize() { _naturalBiomesData.Clear(); var natural = JsonConvert.DeserializeObject <NaturalRootObject>(await StringProcess.GetJsonString("Natural.json")); foreach (var natureBiomesItems in natural.Biomes.Nature) { _naturalBiomesData.Add(natureBiomesItems); } foreach (var natureBiomesItems in _naturalBiomesData) { natureBiomesItems.Picture = StringProcess.GetGameResourcePath(natureBiomesItems.Picture); } }
public async Task Deserialize() { _scienceToolData.Clear(); _scienceLightData.Clear(); _scienceNauticalData.Clear(); _scienceSurvivalData.Clear(); _scienceFoodData.Clear(); _scienceTechnologyData.Clear(); _scienceFightData.Clear(); _scienceStructureData.Clear(); _scienceRefineData.Clear(); _scienceMagicData.Clear(); _scienceDressData.Clear(); _scienceAncientData.Clear(); _scienceBookData.Clear(); _scienceShadowData.Clear(); _scienceCritterData.Clear(); _scienceSculptData.Clear(); _scienceCartographyData.Clear(); _scienceOfferingsData.Clear(); _scienceVolcanoData.Clear(); var science = JsonConvert.DeserializeObject <ScienceRootObject>(await StringProcess.GetJsonString("Sciences.json")); foreach (var scienceToolItems in science.Tool.Science) { _scienceToolData.Add(scienceToolItems); } foreach (var scienceToolItems in _scienceToolData) { scienceToolItems.Picture = StringProcess.GetGameResourcePath(scienceToolItems.Picture); } foreach (var scienceLightItems in science.Light.Science) { _scienceLightData.Add(scienceLightItems); } foreach (var scienceLightItems in _scienceLightData) { scienceLightItems.Picture = StringProcess.GetGameResourcePath(scienceLightItems.Picture); } foreach (var scienceNauticalItems in science.Nautical.Science) { _scienceNauticalData.Add(scienceNauticalItems); } foreach (var scienceNauticalItems in _scienceNauticalData) { scienceNauticalItems.Picture = StringProcess.GetGameResourcePath(scienceNauticalItems.Picture); } foreach (var scienceSurvivalItems in science.Survival.Science) { _scienceSurvivalData.Add(scienceSurvivalItems); } foreach (var scienceSurvivalItems in _scienceSurvivalData) { scienceSurvivalItems.Picture = StringProcess.GetGameResourcePath(scienceSurvivalItems.Picture); } foreach (var scienceFoodItems in science.Foods.Science) { _scienceFoodData.Add(scienceFoodItems); } foreach (var scienceFoodItems in _scienceFoodData) { scienceFoodItems.Picture = StringProcess.GetGameResourcePath(scienceFoodItems.Picture); } foreach (var scienceTechnologyItems in science.Technology.Science) { _scienceTechnologyData.Add(scienceTechnologyItems); } foreach (var scienceTechnologyItems in _scienceTechnologyData) { scienceTechnologyItems.Picture = StringProcess.GetGameResourcePath(scienceTechnologyItems.Picture); } foreach (var scienceFightItems in science.Fight.Science) { _scienceFightData.Add(scienceFightItems); } foreach (var scienceFightItems in _scienceFightData) { scienceFightItems.Picture = StringProcess.GetGameResourcePath(scienceFightItems.Picture); } foreach (var scienceStructureItems in science.Structure.Science) { _scienceStructureData.Add(scienceStructureItems); } foreach (var scienceStructureItems in _scienceStructureData) { scienceStructureItems.Picture = StringProcess.GetGameResourcePath(scienceStructureItems.Picture); } foreach (var scienceRefineItems in science.Refine.Science) { _scienceRefineData.Add(scienceRefineItems); } foreach (var scienceRefineItems in _scienceRefineData) { scienceRefineItems.Picture = StringProcess.GetGameResourcePath(scienceRefineItems.Picture); } foreach (var scienceMagicItems in science.Magic.Science) { _scienceMagicData.Add(scienceMagicItems); } foreach (var scienceMagicItems in _scienceMagicData) { scienceMagicItems.Picture = StringProcess.GetGameResourcePath(scienceMagicItems.Picture); } foreach (var scienceDressItems in science.Dress.Science) { _scienceDressData.Add(scienceDressItems); } foreach (var scienceDressItems in _scienceDressData) { scienceDressItems.Picture = StringProcess.GetGameResourcePath(scienceDressItems.Picture); } foreach (var scienceAncientItems in science.Ancient.Science) { _scienceAncientData.Add(scienceAncientItems); } foreach (var scienceAncientItems in _scienceAncientData) { scienceAncientItems.Picture = StringProcess.GetGameResourcePath(scienceAncientItems.Picture); } foreach (var scienceBookItems in science.Book.Science) { _scienceBookData.Add(scienceBookItems); } foreach (var scienceBookItems in _scienceBookData) { scienceBookItems.Picture = StringProcess.GetGameResourcePath(scienceBookItems.Picture); } foreach (var scienceShadowItems in science.Shadow.Science) { _scienceShadowData.Add(scienceShadowItems); } foreach (var scienceShadowItems in _scienceShadowData) { scienceShadowItems.Picture = StringProcess.GetGameResourcePath(scienceShadowItems.Picture); } foreach (var scienceCritterItems in science.Critter.Science) { _scienceCritterData.Add(scienceCritterItems); } foreach (var scienceCritterItems in _scienceCritterData) { scienceCritterItems.Picture = StringProcess.GetGameResourcePath(scienceCritterItems.Picture); } foreach (var scienceSculptItems in science.Sculpt.Science) { _scienceSculptData.Add(scienceSculptItems); } foreach (var scienceSculptItems in _scienceSculptData) { scienceSculptItems.Picture = StringProcess.GetGameResourcePath(scienceSculptItems.Picture); } foreach (var scienceCartographyItems in science.Cartography.Science) { _scienceCartographyData.Add(scienceCartographyItems); } foreach (var scienceCartographyItems in _scienceCartographyData) { scienceCartographyItems.Picture = StringProcess.GetGameResourcePath(scienceCartographyItems.Picture); } foreach (var scienceOfferingsItems in science.Offerings.Science) { _scienceOfferingsData.Add(scienceOfferingsItems); } foreach (var scienceOfferingsItems in _scienceOfferingsData) { scienceOfferingsItems.Picture = StringProcess.GetGameResourcePath(scienceOfferingsItems.Picture); } foreach (var scienceVolcanoItems in science.Volcano.Science) { _scienceVolcanoData.Add(scienceVolcanoItems); } foreach (var scienceVolcanoItems in _scienceVolcanoData) { scienceVolcanoItems.Picture = StringProcess.GetGameResourcePath(scienceVolcanoItems.Picture); } }
/// <summary> /// 读取世界选项的文件,赋值到selectConfigWorld,类型 /// </summary> private void ReadEditWorldJson() { // 先清空,再赋值 _leveldataOverrideObject = new LeveldataoverrideObject(); // 读取文件,填入到字典 var serverConfig = JsonConvert.DeserializeObject <EditWorldRootObject>(StringProcess.GetJsonString("EditWorld/EditWorld.json")); if (!_isCave) { var master = serverConfig.EditWorld.Master; foreach (var world in master.World) { _leveldataOverrideObject.World.Add(new LeveldataoverrideWorld { Picture = @"/Resources/DedicatedServer/World/" + world.Key + ".png", Key = world.Key, Value = world.Value.Split(',').ToList() }); } foreach (var resources in master.Resources) { _leveldataOverrideObject.Resources.Add(new LeveldataoverrideResources { Picture = @"/Resources/DedicatedServer/World/" + resources.Key + ".png", Key = resources.Key, Value = resources.Value.Split(',').ToList() }); } foreach (var foods in master.Foods) { _leveldataOverrideObject.Foods.Add(new LeveldataoverrideFoods { Picture = @"/Resources/DedicatedServer/World/" + foods.Key + ".png", Key = foods.Key, Value = foods.Value.Split(',').ToList() }); } foreach (var animals in master.Animals) { _leveldataOverrideObject.Animals.Add(new LeveldataoverrideAnimals { Picture = @"/Resources/DedicatedServer/World/" + animals.Key + ".png", Key = animals.Key, Value = animals.Value.Split(',').ToList() }); } foreach (var monsters in master.Monsters) { _leveldataOverrideObject.Monsters.Add(new LeveldataoverrideMonsters { Picture = @"/Resources/DedicatedServer/World/" + monsters.Key + ".png", Key = monsters.Key, Value = monsters.Value.Split(',').ToList() }); } foreach (var world in _leveldataOverrideObject.World) { world.Index = GetIndex(world); } foreach (var resources in _leveldataOverrideObject.Resources) { resources.Index = GetIndex(resources); } foreach (var foods in _leveldataOverrideObject.Foods) { foods.Index = GetIndex(foods); } foreach (var animals in _leveldataOverrideObject.Animals) { animals.Index = GetIndex(animals); } foreach (var monsters in _leveldataOverrideObject.Monsters) { monsters.Index = GetIndex(monsters); } } else { var caves = serverConfig.EditWorld.Caves; foreach (var world in caves.World) { _leveldataOverrideObject.World.Add(new LeveldataoverrideWorld { Picture = @"/Resources/DedicatedServer/World/" + world.Key + ".png", Key = world.Key, Value = world.Value.Split(',').ToList() }); } foreach (var resources in caves.Resources) { _leveldataOverrideObject.Resources.Add(new LeveldataoverrideResources { Picture = @"/Resources/DedicatedServer/World/" + resources.Key + ".png", Key = resources.Key, Value = resources.Value.Split(',').ToList() }); } foreach (var foods in caves.Foods) { _leveldataOverrideObject.Foods.Add(new LeveldataoverrideFoods { Picture = @"/Resources/DedicatedServer/World/" + foods.Key + ".png", Key = foods.Key, Value = foods.Value.Split(',').ToList() }); } foreach (var animals in caves.Animals) { _leveldataOverrideObject.Animals.Add(new LeveldataoverrideAnimals { Picture = @"/Resources/DedicatedServer/World/" + animals.Key + ".png", Key = animals.Key, Value = animals.Value.Split(',').ToList() }); } foreach (var monsters in caves.Monsters) { _leveldataOverrideObject.Monsters.Add(new LeveldataoverrideMonsters { Picture = @"/Resources/DedicatedServer/World/" + monsters.Key + ".png", Key = monsters.Key, Value = monsters.Value.Split(',').ToList() }); } foreach (var world in _leveldataOverrideObject.World) { world.Index = GetIndex(world); } foreach (var resources in _leveldataOverrideObject.Resources) { resources.Index = GetIndex(resources); } foreach (var foods in _leveldataOverrideObject.Foods) { foods.Index = GetIndex(foods); } foreach (var animals in _leveldataOverrideObject.Animals) { animals.Index = GetIndex(animals); } foreach (var monsters in _leveldataOverrideObject.Monsters) { monsters.Index = GetIndex(monsters); } } }
public async Task Deserialize() { _characterData.Clear(); var character = JsonConvert.DeserializeObject <CharacterRootObject>(await StringProcess.GetJsonString("Characters.json")); foreach (var characterItems in character.Character) { _characterData.Add(characterItems); } foreach (var characterItems in _characterData) { characterItems.Picture = StringProcess.GetGameResourcePath(characterItems.Picture); } }
public async Task Deserialize() { _goodMaterialData.Clear(); _goodEquipmentData.Clear(); _goodSaplingData.Clear(); _goodCreaturesData.Clear(); _goodTrinketsData.Clear(); _goodTurfData.Clear(); _goodPetData.Clear(); _goodUnlockData.Clear(); _goodHallowedNightsData.Clear(); _goodWintersFeastData.Clear(); _goodYearOfTheGobblerData.Clear(); _goodComponentData.Clear(); _goodOthersData.Clear(); var good = JsonConvert.DeserializeObject <GoodsRootObject>(await StringProcess.GetJsonString("Goods.json")); foreach (var goodMaterialItems in good.Material.GoodMaterial) { _goodMaterialData.Add(goodMaterialItems); } foreach (var goodMaterialItems in _goodMaterialData) { goodMaterialItems.Picture = StringProcess.GetGameResourcePath(goodMaterialItems.Picture); } foreach (var goodEquipmentItems in good.Equipment.GoodEquipment) { _goodEquipmentData.Add(goodEquipmentItems); } foreach (var goodEquipmentItems in _goodEquipmentData) { goodEquipmentItems.Picture = StringProcess.GetGameResourcePath(goodEquipmentItems.Picture); } foreach (var goodSaplingItems in good.Sapling.GoodSapling) { _goodSaplingData.Add(goodSaplingItems); } foreach (var goodSaplingItems in _goodSaplingData) { goodSaplingItems.Picture = StringProcess.GetGameResourcePath(goodSaplingItems.Picture); } foreach (var goodCreaturesItems in good.Creatures.GoodCreatures) { _goodCreaturesData.Add(goodCreaturesItems); } foreach (var goodCreaturesItems in _goodCreaturesData) { goodCreaturesItems.Picture = StringProcess.GetGameResourcePath(goodCreaturesItems.Picture); } foreach (var goodTrinketsItems in good.Trinkets.GoodTrinkets) { _goodTrinketsData.Add(goodTrinketsItems); } foreach (var goodTrinketsItems in _goodTrinketsData) { goodTrinketsItems.Picture = StringProcess.GetGameResourcePath(goodTrinketsItems.Picture); } foreach (var goodTurfItems in good.Turf.GoodTurf) { _goodTurfData.Add(goodTurfItems); } foreach (var goodTurfItems in _goodTurfData) { goodTurfItems.Picture = StringProcess.GetGameResourcePath(goodTurfItems.Picture); } foreach (var goodPetItems in good.Pet.GoodPet) { _goodPetData.Add(goodPetItems); } foreach (var goodPetItems in _goodPetData) { goodPetItems.Picture = StringProcess.GetGameResourcePath(goodPetItems.Picture); } foreach (var goodUnlockItems in good.Unlock.GoodUnlock) { _goodUnlockData.Add(goodUnlockItems); } foreach (var goodUnlockItems in _goodUnlockData) { goodUnlockItems.Picture = StringProcess.GetGameResourcePath(goodUnlockItems.Picture); } foreach (var goodHallowedNightsItems in good.HallowedNights.Good) { _goodHallowedNightsData.Add(goodHallowedNightsItems); } foreach (var goodHallowedNightsItems in _goodHallowedNightsData) { goodHallowedNightsItems.Picture = StringProcess.GetGameResourcePath(goodHallowedNightsItems.Picture); } foreach (var goodWintersFeastItems in good.WintersFeast.Good) { _goodWintersFeastData.Add(goodWintersFeastItems); } foreach (var goodWintersFeastItems in _goodWintersFeastData) { goodWintersFeastItems.Picture = StringProcess.GetGameResourcePath(goodWintersFeastItems.Picture); } foreach (var goodYearOfTheGobblerItems in good.YearOfTheGobbler.Good) { _goodYearOfTheGobblerData.Add(goodYearOfTheGobblerItems); } foreach (var goodYearOfTheGobblerItems in _goodYearOfTheGobblerData) { goodYearOfTheGobblerItems.Picture = StringProcess.GetGameResourcePath(goodYearOfTheGobblerItems.Picture); } foreach (var goodComponentItems in good.Component.Good) { _goodComponentData.Add(goodComponentItems); } foreach (var goodComponentItems in _goodComponentData) { goodComponentItems.Picture = StringProcess.GetGameResourcePath(goodComponentItems.Picture); } foreach (var goodGoodOthersItems in good.GoodOthers.Good) { _goodOthersData.Add(goodGoodOthersItems); } foreach (var goodGoodOthersItems in _goodOthersData) { goodGoodOthersItems.Picture = StringProcess.GetGameResourcePath(goodGoodOthersItems.Picture); } }
public async Task Deserialize() { _creatureLandData.Clear(); _creatureOceanData.Clear(); _creatureFlyData.Clear(); _creatureCaveData.Clear(); _creatureEvilData.Clear(); _creatureOthersData.Clear(); _creatureBossData.Clear(); var creature = JsonConvert.DeserializeObject <CreaturesRootObject>(await StringProcess.GetJsonString("Creatures.json")); foreach (var creatureLandItems in creature.Land.Creature) { _creatureLandData.Add(creatureLandItems); } foreach (var creatureLandItems in _creatureLandData) { creatureLandItems.Picture = StringProcess.GetGameResourcePath(creatureLandItems.Picture); } foreach (var creatureOceanItems in creature.Ocean.Creature) { _creatureOceanData.Add(creatureOceanItems); } foreach (var creatureOceanItems in _creatureOceanData) { creatureOceanItems.Picture = StringProcess.GetGameResourcePath(creatureOceanItems.Picture); } foreach (var creatureFlyItems in creature.Fly.Creature) { _creatureFlyData.Add(creatureFlyItems); } foreach (var creatureFlyItems in _creatureFlyData) { creatureFlyItems.Picture = StringProcess.GetGameResourcePath(creatureFlyItems.Picture); } foreach (var creatureCaveItems in creature.Cave.Creature) { _creatureCaveData.Add(creatureCaveItems); } foreach (var creatureCaveItems in _creatureCaveData) { creatureCaveItems.Picture = StringProcess.GetGameResourcePath(creatureCaveItems.Picture); } foreach (var creatureEvilItems in creature.Evil.Creature) { _creatureEvilData.Add(creatureEvilItems); } foreach (var creatureEvilItems in _creatureEvilData) { creatureEvilItems.Picture = StringProcess.GetGameResourcePath(creatureEvilItems.Picture); } foreach (var creatureOthersItems in creature.Others.Creature) { _creatureOthersData.Add(creatureOthersItems); } foreach (var creatureOthersItems in _creatureOthersData) { creatureOthersItems.Picture = StringProcess.GetGameResourcePath(creatureOthersItems.Picture); } foreach (var creatureBossItems in creature.Boss.Creature) { _creatureBossData.Add(creatureBossItems); } foreach (var creatureBossItems in _creatureBossData) { creatureBossItems.Picture = StringProcess.GetGameResourcePath(creatureBossItems.Picture); } }
/// <summary> /// 显示具体分类信息 /// </summary> private void ConsoleRadioButton_Click(object sender, RoutedEventArgs e) { ConsoleDetailsWrapPanel.Children.Clear(); // 读取分类信息 var itemList = JsonConvert.DeserializeObject <ItemListRootObject>(StringProcess.GetJsonString("ItemList.json")); // 把当前选择的值放到这里了 ConsoleClassificationStackPanel.Tag = ((RadioButton)sender).Content; // 显示具体分类信息 switch (ConsoleClassificationStackPanel.Tag) { case "其他": foreach (var detail in itemList.Items.Other.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "食物": foreach (var detail in itemList.Items.Food.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "资源": foreach (var detail in itemList.Items.Resources.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "工具": foreach (var detail in itemList.Items.Tools.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "武器": foreach (var detail in itemList.Items.Weapons.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "礼物": foreach (var detail in itemList.Items.Gifts.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; case "衣物": foreach (var detail in itemList.Items.Clothes.Details) { if (string.IsNullOrEmpty(detail.Chinese)) { continue; } CreateConsoleButton(detail); } break; } }