diff options
Diffstat (limited to 'src/SMAPI/Events/MineEvents.cs')
-rw-r--r-- | src/SMAPI/Events/MineEvents.cs | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/SMAPI/Events/MineEvents.cs b/src/SMAPI/Events/MineEvents.cs index 9cf7edac..5ee4001b 100644 --- a/src/SMAPI/Events/MineEvents.cs +++ b/src/SMAPI/Events/MineEvents.cs @@ -1,5 +1,5 @@ -using System; -using StardewModdingAPI.Framework; +using System; +using StardewModdingAPI.Framework.Events; namespace StardewModdingAPI.Events { @@ -7,22 +7,31 @@ namespace StardewModdingAPI.Events public static class MineEvents { /********* + ** Properties + *********/ + /// <summary>The core event manager.</summary> + private static EventManager EventManager; + + + /********* ** Events *********/ /// <summary>Raised after the player warps to a new level of the mine.</summary> - public static event EventHandler<EventArgsMineLevelChanged> MineLevelChanged; + public static event EventHandler<EventArgsMineLevelChanged> MineLevelChanged + { + add => MineEvents.EventManager.Mine_LevelChanged.Add(value); + remove => MineEvents.EventManager.Mine_LevelChanged.Remove(value); + } /********* - ** Internal methods + ** Public methods *********/ - /// <summary>Raise a <see cref="MineLevelChanged"/> event.</summary> - /// <param name="monitor">Encapsulates monitoring and logging.</param> - /// <param name="previousMineLevel">The previous mine level.</param> - /// <param name="currentMineLevel">The current mine level.</param> - internal static void InvokeMineLevelChanged(IMonitor monitor, int previousMineLevel, int currentMineLevel) + /// <summary>Initialise the events.</summary> + /// <param name="eventManager">The core event manager.</param> + internal static void Init(EventManager eventManager) { - monitor.SafelyRaiseGenericEvent($"{nameof(MineEvents)}.{nameof(MineEvents.MineLevelChanged)}", MineEvents.MineLevelChanged?.GetInvocationList(), null, new EventArgsMineLevelChanged(previousMineLevel, currentMineLevel)); + MineEvents.EventManager = eventManager; } } } |