/// <summary>Get the enabled data layers.</summary> /// <param name="config">The mod configuration.</param> /// <param name="translation">Provides translations for the mod.</param> /// <param name="mods">Handles access to the supported mod integrations.</param> private IEnumerable <ILayer> GetLayers(ModConfig config, ITranslationHelper translation, ModIntegrations mods) { ModConfig.LayerConfigs layers = config.Layers; if (layers.Accessible.IsEnabled()) { yield return(new AccessibleLayer(translation, layers.Accessible)); } if (layers.Buildable.IsEnabled()) { yield return(new BuildableLayer(translation, layers.Buildable)); } if (layers.CoverageForBeeHouses.IsEnabled()) { yield return(new BeeHouseLayer(translation, layers.CoverageForBeeHouses, hasBeeHouseFlowerRangeFix: mods.HasMod("kirbylink.beehousefix"))); } if (layers.CoverageForScarecrows.IsEnabled()) { yield return(new ScarecrowLayer(translation, layers.CoverageForScarecrows, mods)); } if (layers.CoverageForSprinklers.IsEnabled()) { yield return(new SprinklerLayer(translation, layers.CoverageForSprinklers, mods)); } if (layers.CoverageForJunimoHuts.IsEnabled()) { yield return(new JunimoHutLayer(translation, layers.CoverageForJunimoHuts, mods)); } if (layers.CropWater.IsEnabled()) { yield return(new CropWaterLayer(translation, layers.CropWater)); } if (layers.CropFertilizer.IsEnabled()) { yield return(new CropFertilizerLayer(translation, layers.CropFertilizer)); } if (layers.CropHarvest.IsEnabled()) { yield return(new CropHarvestLayer(translation, layers.CropHarvest)); } if (layers.Machines.IsEnabled() && mods.Automate.IsLoaded) { yield return(new MachineLayer(translation, layers.Machines, mods)); } if (layers.Tillable.IsEnabled()) { yield return(new TillableLayer(translation, layers.Tillable)); } }
/// <summary>Get the enabled data layers.</summary> /// <param name="config">The mod configuration.</param> /// <param name="translation">Provides translations for the mod.</param> /// <param name="mods">Handles access to the supported mod integrations.</param> private IEnumerable <ILayer> GetLayers(ModConfig config, ITranslationHelper translation, ModIntegrations mods) { ModConfig.LayerConfigs layers = config.Layers; if (layers.Accessibility.IsEnabled()) { yield return(new AccessibilityLayer(translation, layers.Accessibility)); } if (layers.CoverageForBeeHouses.IsEnabled()) { yield return(new BeeHouseLayer(translation, layers.CoverageForBeeHouses)); } if (layers.CoverageForScarecrows.IsEnabled()) { yield return(new ScarecrowLayer(translation, layers.CoverageForScarecrows, mods)); } if (layers.CoverageForSprinklers.IsEnabled()) { yield return(new SprinklerLayer(translation, layers.CoverageForSprinklers, mods)); } if (layers.CoverageForJunimoHuts.IsEnabled()) { yield return(new JunimoHutLayer(translation, layers.CoverageForJunimoHuts, mods)); } if (layers.CropWater.IsEnabled()) { yield return(new CropWaterLayer(translation, layers.CropWater)); } if (layers.CropFertilizer.IsEnabled()) { yield return(new CropFertilizerLayer(translation, layers.CropFertilizer)); } if (layers.CropHarvest.IsEnabled()) { yield return(new CropHarvestLayer(translation, layers.CropHarvest)); } if (layers.Machines.IsEnabled() && mods.Automate.IsLoaded) { yield return(new MachineLayer(translation, layers.Machines, mods)); } }