private static void AddCustomData(string classId, LootDistributionData.SrcData customSrcData, Dictionary <string, LootDistributionData.SrcData> srcDistribution, Dictionary <BiomeType, LootDistributionData.DstData> dstDistribution)
        {
            srcDistribution.Add(classId, customSrcData);

            List <LootDistributionData.BiomeData> distribution = customSrcData.distribution;

            if (distribution != null)
            {
                for (int i = 0; i < distribution.Count; i++)
                {
                    LootDistributionData.BiomeData biomeData = distribution[i];
                    BiomeType biome       = biomeData.biome;
                    int       count       = biomeData.count;
                    float     probability = biomeData.probability;

                    if (!dstDistribution.TryGetValue(biome, out LootDistributionData.DstData dstData))
                    {
                        dstData = new LootDistributionData.DstData
                        {
                            prefabs = new List <LootDistributionData.PrefabData>()
                        };
                        dstDistribution.Add(biome, dstData);
                    }

                    var prefabData = new LootDistributionData.PrefabData
                    {
                        classId     = classId,
                        count       = count,
                        probability = probability
                    };
                    dstData.prefabs.Add(prefabData);
                }
            }
        }
        private static void EditExistingData(string classId, LootDistributionData.SrcData existingData, LootDistributionData.SrcData changes, Dictionary <BiomeType, LootDistributionData.DstData> dstData)
        {
            foreach (LootDistributionData.BiomeData customBiomeDist in changes.distribution)
            {
                bool foundBiome = false;

                for (int i = 0; i < existingData.distribution.Count; i++)
                {
                    LootDistributionData.BiomeData biomeDist = existingData.distribution[i];

                    if (customBiomeDist.biome == biomeDist.biome)
                    {
                        biomeDist.count       = customBiomeDist.count;
                        biomeDist.probability = customBiomeDist.probability;

                        foundBiome = true;
                    }
                }

                if (!foundBiome)
                {
                    existingData.distribution.Add(customBiomeDist);
                }

                if (!dstData.TryGetValue(customBiomeDist.biome, out LootDistributionData.DstData biomeDistData))
                {
                    biomeDistData = new LootDistributionData.DstData
                    {
                        prefabs = new List <LootDistributionData.PrefabData>()
                    };
                    dstData.Add(customBiomeDist.biome, biomeDistData);
                }

                bool foundPrefab = false;

                for (int j = 0; j < biomeDistData.prefabs.Count; j++)
                {
                    LootDistributionData.PrefabData prefabData = biomeDistData.prefabs[j];

                    if (prefabData.classId == classId)
                    {
                        prefabData.count       = customBiomeDist.count;
                        prefabData.probability = customBiomeDist.probability;

                        foundPrefab = true;
                    }
                }

                if (!foundPrefab)
                {
                    biomeDistData.prefabs.Add(new LootDistributionData.PrefabData()
                    {
                        classId     = classId,
                        count       = customBiomeDist.count,
                        probability = customBiomeDist.probability
                    });
                }
            }
        }