summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Events/PlayerEvents.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-03 01:03:13 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-03 01:03:13 -0400
commit771263299cae11d464c25c5291e59507c639e822 (patch)
tree73c60cb5f9eed250ec37596a5ab9477c36194998 /src/StardewModdingAPI/Events/PlayerEvents.cs
parent8c1bf732ff6bbf2056b7416887354020d10a7ca9 (diff)
downloadSMAPI-771263299cae11d464c25c5291e59507c639e822.tar.gz
SMAPI-771263299cae11d464c25c5291e59507c639e822.tar.bz2
SMAPI-771263299cae11d464c25c5291e59507c639e822.zip
add SMAPI 2.0 compile mode
Diffstat (limited to 'src/StardewModdingAPI/Events/PlayerEvents.cs')
-rw-r--r--src/StardewModdingAPI/Events/PlayerEvents.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Events/PlayerEvents.cs b/src/StardewModdingAPI/Events/PlayerEvents.cs
index 37649fee..efada876 100644
--- a/src/StardewModdingAPI/Events/PlayerEvents.cs
+++ b/src/StardewModdingAPI/Events/PlayerEvents.cs
@@ -15,6 +15,7 @@ namespace StardewModdingAPI.Events
/*********
** Properties
*********/
+#if !SMAPI_2_0
/// <summary>Manages deprecation warnings.</summary>
private static DeprecationManager DeprecationManager;
@@ -25,11 +26,13 @@ namespace StardewModdingAPI.Events
/// <summary>The backing field for <see cref="FarmerChanged"/>.</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
private static event EventHandler<EventArgsFarmerChanged> _FarmerChanged;
+#endif
/*********
** Events
*********/
+#if !SMAPI_2_0
/// <summary>Raised after the player loads a saved game.</summary>
[Obsolete("Use " + nameof(SaveEvents) + "." + nameof(SaveEvents.AfterLoad) + " instead")]
public static event EventHandler<EventArgsLoadedGameChanged> LoadedGame
@@ -53,6 +56,7 @@ namespace StardewModdingAPI.Events
}
remove => PlayerEvents._FarmerChanged -= value;
}
+#endif
/// <summary>Raised after the player's inventory changes in any way (added or removed item, sorted, etc).</summary>
public static event EventHandler<EventArgsInventoryChanged> InventoryChanged;
@@ -64,6 +68,7 @@ namespace StardewModdingAPI.Events
/*********
** Internal methods
*********/
+#if !SMAPI_2_0
/// <summary>Injects types required for backwards compatibility.</summary>
/// <param name="deprecationManager">Manages deprecation warnings.</param>
internal static void Shim(DeprecationManager deprecationManager)
@@ -87,6 +92,7 @@ namespace StardewModdingAPI.Events
{
monitor.SafelyRaiseGenericEvent($"{nameof(PlayerEvents)}.{nameof(PlayerEvents.FarmerChanged)}", PlayerEvents._FarmerChanged?.GetInvocationList(), null, new EventArgsFarmerChanged(priorFarmer, newFarmer));
}
+#endif
/// <summary>Raise an <see cref="InventoryChanged"/> event.</summary>
/// <param name="monitor">Encapsulates monitoring and logging.</param>