private LocationConfigManager Config = null !; // set in Entry /********* ** Public methods *********/ /// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { // read config this.Config = new LocationConfigManager( helper.ReadConfig <ModConfig>() ); // read data var fallbackTileTypes = this.LoadFallbackTileTypes(); // add patches HarmonyPatcher.Apply(this, new LocationPatcher(this.Monitor, this.Config, fallbackTileTypes) ); }
/********* ** Public methods *********/ /// <summary>Initialize the Harmony patches.</summary> /// <param name="monitor">Encapsulates logging for the Harmony patch.</param> /// <param name="config">The mod configuration.</param> /// <param name="fallbackTileTypes">The tile types to use for tiles which don't have a type property and aren't marked diggable. Indexed by tilesheet image source (without path or season) and back tile ID.</param> public LocationPatcher(IMonitor monitor, LocationConfigManager config, Dictionary <string, Dictionary <int, string> > fallbackTileTypes) { LocationPatcher.Monitor = monitor; LocationPatcher.Config = config; LocationPatcher.FallbackTileTypes = fallbackTileTypes; }