summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/MineEvents.cs
blob: 9cf7edac12d3f820a283691b1c1d1d390617c519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using StardewModdingAPI.Framework;

namespace StardewModdingAPI.Events
{
    /// <summary>Events raised when something happens in the mines.</summary>
    public static class MineEvents
    {
        /*********
        ** Events
        *********/
        /// <summary>Raised after the player warps to a new level of the mine.</summary>
        public static event EventHandler<EventArgsMineLevelChanged> MineLevelChanged;


        /*********
        ** Internal 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)
        {
            monitor.SafelyRaiseGenericEvent($"{nameof(MineEvents)}.{nameof(MineEvents.MineLevelChanged)}", MineEvents.MineLevelChanged?.GetInvocationList(), null, new EventArgsMineLevelChanged(previousMineLevel, currentMineLevel));
        }
    }
}