summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Entities/SPlayer.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-11-19 18:56:35 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-11-19 18:56:35 -0500
commit1a5eb12cc6877da6dd95bcae8814bc5d3fb87a9b (patch)
tree6c64f162639d5bfcdb7354696d285b86106d2c8b /src/StardewModdingAPI/Entities/SPlayer.cs
parent7cb77dd2be419eac4135278cf7aefb2f3ddf1b36 (diff)
downloadSMAPI-1a5eb12cc6877da6dd95bcae8814bc5d3fb87a9b.tar.gz
SMAPI-1a5eb12cc6877da6dd95bcae8814bc5d3fb87a9b.tar.bz2
SMAPI-1a5eb12cc6877da6dd95bcae8814bc5d3fb87a9b.zip
restore obsolete SPlayer for backwards compatibility, mark deprecated
Diffstat (limited to 'src/StardewModdingAPI/Entities/SPlayer.cs')
-rw-r--r--src/StardewModdingAPI/Entities/SPlayer.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Entities/SPlayer.cs b/src/StardewModdingAPI/Entities/SPlayer.cs
new file mode 100644
index 00000000..66c7ba44
--- /dev/null
+++ b/src/StardewModdingAPI/Entities/SPlayer.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using StardewModdingAPI.Framework;
+using StardewValley;
+
+namespace StardewModdingAPI.Entities
+{
+ /// <summary>Static class for integrating with the player.</summary>
+ [Obsolete("This API was never officially documented and will be removed soon.")]
+ public class SPlayer
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>Obsolete.</summary>
+ [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.getAllFarmers) + " instead")]
+ public static List<Farmer> AllFarmers
+ {
+ get
+ {
+ Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
+ return Game1.getAllFarmers();
+ }
+ }
+
+ /// <summary>Obsolete.</summary>
+ [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + " instead")]
+ public static Farmer CurrentFarmer
+ {
+ get
+ {
+ Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
+ return Game1.player;
+ }
+ }
+
+ /// <summary>Obsolete.</summary>
+ [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + " instead")]
+ public static Farmer Player
+ {
+ get
+ {
+ Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
+ return Game1.player;
+ }
+ }
+
+ /// <summary>Obsolete.</summary>
+ [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + "." + nameof(Farmer.currentLocation) + " instead")]
+ public static GameLocation CurrentFarmerLocation
+ {
+ get
+ {
+ Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
+ return Game1.player.currentLocation;
+ }
+ }
+ }
+} \ No newline at end of file