/********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="translations">Provides translations in stored in the mod folder's i18n folder.</param> /// <param name="config">The data map settings.</param> /// <param name="pelicanFiber">Handles access to the Pelican Fiber mod.</param> public JunimoHutMap(ITranslationHelper translations, MapConfig config, PelicanFiberIntegration pelicanFiber) : base(translations.Get("maps.junimo-huts.name"), config) { this.PelicanFiber = pelicanFiber; this.Legend = new[] { new LegendEntry(translations.Get("maps.junimo-huts.can-harvest"), this.CoveredColor), new LegendEntry(translations.Get("maps.junimo-huts.cannot-harvest"), this.NotCoveredColor) }; }
/********* ** Private methods *********/ /// <summary>The method invoked on the first game update tick.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void GameEvents_FirstUpdateTick(object sender, EventArgs e) { IModHelper helper = this.Helper; this.PelicanFiber = new PelicanFiberIntegration(helper.ModRegistry, helper.Reflection, this.Monitor); var betterSprinklers = new BetterSprinklersIntegration(helper.ModRegistry, this.Monitor); var cobalt = new CobaltIntegration(helper.ModRegistry, this.Monitor); var simpleSprinklers = new SimpleSprinklerIntegration(helper.ModRegistry, this.Monitor); this.Maps = this.GetDataMaps(this.Config, this.Helper.Translation, this.PelicanFiber, betterSprinklers, cobalt, simpleSprinklers).ToArray(); }
/********* ** Private methods *********/ /// <summary>The method invoked on the first game update tick.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void GameEvents_FirstUpdateTick(object sender, EventArgs e) { IModHelper helper = this.Helper; this.PelicanFiber = new PelicanFiberIntegration(helper.ModRegistry, helper.Reflection, this.Monitor); var betterSprinklers = new BetterSprinklersIntegration(helper.ModRegistry, this.Monitor); var cobalt = new CobaltIntegration(helper.ModRegistry, this.Monitor); var simpleSprinklers = new SimpleSprinklerIntegration(helper.ModRegistry, this.Monitor); this.Maps = new IDataMap[] { new AccessibilityMap(helper.Translation), new BeeHouseMap(helper.Translation), new ScarecrowMap(helper.Translation), new SprinklerMap(helper.Translation, betterSprinklers, cobalt, simpleSprinklers), new JunimoHutMap(helper.Translation, this.PelicanFiber) }; }
/// <summary>Get the enabled data maps.</summary> /// <param name="config">The mod configuration.</param> /// <param name="translation">Provides translations for the mod.</param> /// <param name="pelicanFiber">Handles access to the Pelican Fiber mod.</param> /// <param name="betterSprinklers">Handles access to the Better Sprinklers mod.</param> /// <param name="cobalt">Handles access to the Cobalt mod.</param> /// <param name="simpleSprinklers">Handles access to the Simple Sprinklers mod.</param> private IEnumerable <IDataMap> GetDataMaps(ModConfig config, ITranslationHelper translation, PelicanFiberIntegration pelicanFiber, BetterSprinklersIntegration betterSprinklers, CobaltIntegration cobalt, SimpleSprinklerIntegration simpleSprinklers) { if (config.EnableMaps.Accessibility) { yield return(new AccessibilityMap(translation)); } if (config.EnableMaps.CoverageForBeeHouses) { yield return(new BeeHouseMap(translation)); } if (config.EnableMaps.CoverageForScarecrows) { yield return(new ScarecrowMap(translation)); } if (config.EnableMaps.CoverageForSprinklers) { yield return(new SprinklerMap(translation, betterSprinklers, cobalt, simpleSprinklers)); } if (config.EnableMaps.CoverageForJunimoHuts) { yield return(new JunimoHutMap(translation, this.PelicanFiber)); } if (config.EnableMaps.CropWater) { yield return(new CropWaterMap(translation)); } if (config.EnableMaps.CropFertilizer) { yield return(new CropFertilizerMap(translation)); } }