diff options
Diffstat (limited to 'src/SMAPI/Events/InputMouseWheelScrolledEventArgs.cs')
-rw-r--r-- | src/SMAPI/Events/InputMouseWheelScrolledEventArgs.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/SMAPI/Events/InputMouseWheelScrolledEventArgs.cs b/src/SMAPI/Events/InputMouseWheelScrolledEventArgs.cs new file mode 100644 index 00000000..9afab9cc --- /dev/null +++ b/src/SMAPI/Events/InputMouseWheelScrolledEventArgs.cs @@ -0,0 +1,38 @@ +using System; + +namespace StardewModdingAPI.Events +{ + /// <summary>Event arguments when the player scrolls the mouse wheel.</summary> + public class InputMouseWheelScrolledEventArgs : EventArgs + { + /********* + ** Accessors + *********/ + /// <summary>The cursor position.</summary> + public ICursorPosition Position { get; } + + /// <summary>The old scroll value.</summary> + public int OldValue { get; } + + /// <summary>The new scroll value.</summary> + public int NewValue { get; } + + /// <summary>The amount by which the scroll value changed.</summary> + public int Delta => this.NewValue - this.OldValue; + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="position">The cursor position.</param> + /// <param name="oldValue">The old scroll value.</param> + /// <param name="newValue">The new scroll value.</param> + public InputMouseWheelScrolledEventArgs(ICursorPosition position, int oldValue, int newValue) + { + this.Position = position; + this.OldValue = oldValue; + this.NewValue = newValue; + } + } +} |