diff options
author | Zoryn Aaron <zoryn4163@gmail.com> | 2016-02-28 20:26:36 -0500 |
---|---|---|
committer | Zoryn Aaron <zoryn4163@gmail.com> | 2016-02-28 20:26:36 -0500 |
commit | cbf741d5ac74a6c4ab1210671cb7ef21826c4fc7 (patch) | |
tree | 3eb8de7a79515580888ae5438f189a678a70fc27 /StardewModdingAPI/Events.cs | |
parent | 868789770dee098d6348a39b9c39dfc0b8d1ac93 (diff) | |
download | SMAPI-cbf741d5ac74a6c4ab1210671cb7ef21826c4fc7.tar.gz SMAPI-cbf741d5ac74a6c4ab1210671cb7ef21826c4fc7.tar.bz2 SMAPI-cbf741d5ac74a6c4ab1210671cb7ef21826c4fc7.zip |
updates
Diffstat (limited to 'StardewModdingAPI/Events.cs')
-rw-r--r-- | StardewModdingAPI/Events.cs | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/StardewModdingAPI/Events.cs b/StardewModdingAPI/Events.cs index 2009ed0f..07be29a6 100644 --- a/StardewModdingAPI/Events.cs +++ b/StardewModdingAPI/Events.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework.Input; namespace StardewModdingAPI { @@ -11,22 +12,51 @@ namespace StardewModdingAPI public delegate void BlankEventHandler(); public static event BlankEventHandler GameLoaded = delegate { }; - public static event BlankEventHandler UpdateInitialized = delegate { }; + public static event BlankEventHandler Initialize = delegate { }; + public static event BlankEventHandler LoadContent = delegate { }; public static event BlankEventHandler UpdateTick = delegate { }; + public static event BlankEventHandler DrawTick = delegate { }; + + public delegate void StateChanged(KeyboardState newState); + public static event StateChanged KeyboardChanged = delegate { }; + + public delegate void KeyStateChanged(Keys key); + public static event KeyStateChanged KeyPressed = delegate { }; + public static void InvokeGameLoaded() { GameLoaded.Invoke(); } - public static void InvokeUpdateInitialized() + public static void InvokeInitialize() + { + Initialize.Invoke(); + } + + public static void InvokeLoadContent() { - UpdateInitialized.Invoke(); + LoadContent.Invoke(); } public static void InvokeUpdateTick() { UpdateTick.Invoke(); } + + public static void InvokeDrawTick() + { + DrawTick.Invoke(); + } + + public static void InvokeKeyboardChanged(KeyboardState newState) + { + KeyboardChanged.Invoke(newState); + } + + public static void InvokeKeyPressed(Keys key) + { + KeyPressed.Invoke(key); + } } } |