From 6045351395f6b74846a2b18b131f662b88641569 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 13 Dec 2018 02:00:30 -0500 Subject: simplify access to deprecation manager for deprecation warnings --- src/SMAPI/Events/GameEvents.cs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/SMAPI/Events/GameEvents.cs') diff --git a/src/SMAPI/Events/GameEvents.cs b/src/SMAPI/Events/GameEvents.cs index 39b77f99..6069a185 100644 --- a/src/SMAPI/Events/GameEvents.cs +++ b/src/SMAPI/Events/GameEvents.cs @@ -15,9 +15,6 @@ namespace StardewModdingAPI.Events /// The core event manager. private static EventManager EventManager; - /// Manages deprecation warnings. - private static DeprecationManager DeprecationManager; - /********* ** Events @@ -27,7 +24,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_UpdateTick.Add(value); } remove => GameEvents.EventManager.Legacy_UpdateTick.Remove(value); @@ -38,7 +35,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_SecondUpdateTick.Add(value); } remove => GameEvents.EventManager.Legacy_SecondUpdateTick.Remove(value); @@ -49,7 +46,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_FourthUpdateTick.Add(value); } remove => GameEvents.EventManager.Legacy_FourthUpdateTick.Remove(value); @@ -60,7 +57,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_EighthUpdateTick.Add(value); } remove => GameEvents.EventManager.Legacy_EighthUpdateTick.Remove(value); @@ -71,7 +68,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_QuarterSecondTick.Add(value); } remove => GameEvents.EventManager.Legacy_QuarterSecondTick.Remove(value); @@ -82,7 +79,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_HalfSecondTick.Add(value); } remove => GameEvents.EventManager.Legacy_HalfSecondTick.Remove(value); @@ -93,7 +90,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_OneSecondTick.Add(value); } remove => GameEvents.EventManager.Legacy_OneSecondTick.Remove(value); @@ -104,7 +101,7 @@ namespace StardewModdingAPI.Events { add { - GameEvents.DeprecationManager.WarnForOldEvents(); + SCore.DeprecationManager.WarnForOldEvents(); GameEvents.EventManager.Legacy_FirstUpdateTick.Add(value); } remove => GameEvents.EventManager.Legacy_FirstUpdateTick.Remove(value); @@ -116,11 +113,9 @@ namespace StardewModdingAPI.Events *********/ /// Initialise the events. /// The core event manager. - /// Manages deprecation warnings. - internal static void Init(EventManager eventManager, DeprecationManager deprecationManager) + internal static void Init(EventManager eventManager) { GameEvents.EventManager = eventManager; - GameEvents.DeprecationManager = deprecationManager; } } } -- cgit