summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/InternalExtensions.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-10-06 00:25:48 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-10-06 00:25:48 -0400
commit14fab29370310a762a000c50b23075326b4e95da (patch)
treea9d38d354a2dee089ce5de4d18f5ec70394ac5a5 /src/SMAPI/Framework/InternalExtensions.cs
parent63fb4dbe8ae4d611c4854f863b9b29265e02fdee (diff)
downloadSMAPI-14fab29370310a762a000c50b23075326b4e95da.tar.gz
SMAPI-14fab29370310a762a000c50b23075326b4e95da.tar.bz2
SMAPI-14fab29370310a762a000c50b23075326b4e95da.zip
add save and day-started events for 3.0 (#310)
Diffstat (limited to 'src/SMAPI/Framework/InternalExtensions.cs')
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs
index ff3925fb..b51ff6a8 100644
--- a/src/SMAPI/Framework/InternalExtensions.cs
+++ b/src/SMAPI/Framework/InternalExtensions.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Xna.Framework.Graphics;
+using StardewModdingAPI.Framework.Events;
using StardewModdingAPI.Framework.Reflection;
using StardewValley;
@@ -40,6 +41,17 @@ namespace StardewModdingAPI.Framework
}
/****
+ ** ManagedEvent
+ ****/
+ /// <summary>Raise the event and notify all handlers.</summary>
+ /// <typeparam name="TEventArgs">The empty event arguments type to construct.</typeparam>
+ /// <param name="event">The event to raise.</param>
+ public static void RaiseEmpty<TEventArgs>(this ManagedEvent<TEventArgs> @event) where TEventArgs : new()
+ {
+ @event.Raise(Singleton<TEventArgs>.Instance);
+ }
+
+ /****
** Exceptions
****/
/// <summary>Get a string representation of an exception suitable for writing to the error log.</summary>