summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Events/Time.cs
diff options
context:
space:
mode:
authorCarl <slxxls92@gmail.com>2016-05-30 01:33:37 +0100
committerCarl <slxxls92@gmail.com>2016-05-30 01:33:37 +0100
commitfa666f803398e29a7ffec0707cd6a1ec3571d3e9 (patch)
tree71099c94fa92196cfb6cdb42a56379e6fdaa4364 /src/StardewModdingAPI/Events/Time.cs
parent4edee54da20e7655ae24cf1ac2abded5ec1ba2c5 (diff)
parent1212222e9f59a68a9f167d20bbddd8a4e1a3cf81 (diff)
downloadSMAPI-fa666f803398e29a7ffec0707cd6a1ec3571d3e9.tar.gz
SMAPI-fa666f803398e29a7ffec0707cd6a1ec3571d3e9.tar.bz2
SMAPI-fa666f803398e29a7ffec0707cd6a1ec3571d3e9.zip
Merge pull request #118 from Gormogon/master
Some Semi-Big Changes
Diffstat (limited to 'src/StardewModdingAPI/Events/Time.cs')
-rw-r--r--src/StardewModdingAPI/Events/Time.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Events/Time.cs b/src/StardewModdingAPI/Events/Time.cs
new file mode 100644
index 00000000..39ca642a
--- /dev/null
+++ b/src/StardewModdingAPI/Events/Time.cs
@@ -0,0 +1,42 @@
+using System;
+
+namespace StardewModdingAPI.Events
+{
+ public static class TimeEvents
+ {
+ public static event EventHandler<EventArgsIntChanged> TimeOfDayChanged = delegate { };
+ public static event EventHandler<EventArgsIntChanged> DayOfMonthChanged = delegate { };
+ public static event EventHandler<EventArgsIntChanged> YearOfGameChanged = delegate { };
+ public static event EventHandler<EventArgsStringChanged> SeasonOfYearChanged = delegate { };
+
+ /// <summary>
+ /// Occurs when Game1.newDay changes. True directly before saving, and False directly after.
+ /// </summary>
+ public static event EventHandler<EventArgsNewDay> OnNewDay = delegate { };
+
+ internal static void InvokeTimeOfDayChanged(int priorInt, int newInt)
+ {
+ TimeOfDayChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ internal static void InvokeDayOfMonthChanged(int priorInt, int newInt)
+ {
+ DayOfMonthChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ internal static void InvokeYearOfGameChanged(int priorInt, int newInt)
+ {
+ YearOfGameChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ internal static void InvokeSeasonOfYearChanged(string priorString, string newString)
+ {
+ SeasonOfYearChanged.Invoke(null, new EventArgsStringChanged(priorString, newString));
+ }
+
+ internal static void InvokeOnNewDay(int priorInt, int newInt, bool newDay)
+ {
+ OnNewDay.Invoke(null, new EventArgsNewDay(priorInt, newInt, newDay));
+ }
+ }
+} \ No newline at end of file