/// <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) { modHelper.Init(helper, this.Monitor); log = modHelper.Log; Agent = new RLAgent(log); try { Agent.ReadQTableFromJson(); } catch (Exception e) { log.Log(e.Message); } config = modHelper.Config; log.Silly("Created log and config for mod entry. Loading Harmony."); hWrapper.InitHarmony(helper, config, log); log.Silly("Loading event handlers"); helper.Events.GameLoop.UpdateTicked += OnUpdateTicked; helper.Events.Player.InventoryChanged += OnInventoryChanged; helper.Events.Display.MenuChanged += OnMenuChanged; }
/// <summary> /// Entry point for the mod. Uses helpers to set up logging, config, and harmony. /// </summary> /// <param name="helper">Provided by SMAPI</param> public override void Entry(IModHelper helper) { modHelper.Init(helper, this.Monitor); log = modHelper.Log; config = modHelper.Config; log.Silly("Loaded ModHelper, now attempted to load Harmony"); hWrapper.InitHarmony(helper, config, log); log.Trace("Finished init, ready for operation"); }
/// <summary> /// Entry point for the mod. Sets up logging, Harmony, and configuration, and preps the mod to fish. /// </summary> /// <param name="helper"></param> public override void Entry(IModHelper helper) { modHelper.Init(helper, this.Monitor); log = modHelper.Log; config = modHelper.Config; log.Silly("Created log and config for mod entry. Loading Harmony."); hWrapper.InitHarmony(helper, config, log); log.Silly("Loading event handlers"); GameEvents.UpdateTick += new EventHandler(OnUpdateTick); GameEvents.HalfSecondTick += new EventHandler(OnHalfSecondTick); automaton = new Lib.FishForMe(helper, config); log.Trace("Finished init, ready for operation"); }