summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/MouseWheelScrolledEventArgs.cs
blob: 0c736b39cf390c17ad6d5ba8a1694c5f663cf737 (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
29
30
31
32
33
34
35
36
37
38
using System;

namespace StardewModdingAPI.Events
{
    /// <summary>Event arguments when the player scrolls the mouse wheel.</summary>
    public class MouseWheelScrolledEventArgs : 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>
        internal MouseWheelScrolledEventArgs(ICursorPosition position, int oldValue, int newValue)
        {
            this.Position = position;
            this.OldValue = oldValue;
            this.NewValue = newValue;
        }
    }
}