summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Events/EventArgsNewDay.cs
blob: b8cbe9e3acc0511840ece84996fc86ba2900f6d0 (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
#if SMAPI_1_x
using System;

namespace StardewModdingAPI.Events
{
    /// <summary>Event arguments for a <see cref="TimeEvents.OnNewDay"/> event.</summary>
    public class EventArgsNewDay : EventArgs
    {
        /*********
        ** Accessors
        *********/
        /// <summary>The previous day value.</summary>
        public int PreviousDay { get; }

        /// <summary>The current day value.</summary>
        public int CurrentDay { get; }

        /// <summary>Whether the game just started the transition (<c>true</c>) or finished it (<c>false</c>).</summary>
        public bool IsNewDay { get; }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="priorDay">The previous day value.</param>
        /// <param name="newDay">The current day value.</param>
        /// <param name="isTransitioning">Whether the game just started the transition (<c>true</c>) or finished it (<c>false</c>).</param>
        public EventArgsNewDay(int priorDay, int newDay, bool isTransitioning)
        {
            this.PreviousDay = priorDay;
            this.CurrentDay = newDay;
            this.IsNewDay = isTransitioning;
        }
    }
}
#endif