summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Inheritance/SGame.cs
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI/Inheritance/SGame.cs')
-rw-r--r--StardewModdingAPI/Inheritance/SGame.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs
index 36f905f7..69439209 100644
--- a/StardewModdingAPI/Inheritance/SGame.cs
+++ b/StardewModdingAPI/Inheritance/SGame.cs
@@ -66,8 +66,15 @@ namespace StardewModdingAPI.Inheritance
public Farmer PreviousFarmer { get; private set; }
+ private static SGame instance;
+ public static SGame Instance { get { return instance; } }
+
+ public Farmer CurrentFarmer { get { return player; } }
+
public SGame()
{
+ instance = this;
+
if (Program.debug)
{
SaveGame.serializer = new XmlSerializer(typeof (SaveGame), new Type[28]
@@ -195,11 +202,7 @@ namespace StardewModdingAPI.Inheritance
public static SGameLocation GetLocationFromName(String name)
{
- if (ModLocations.Any(x => x.name == name))
- {
- return ModLocations[ModLocations.IndexOf(ModLocations.First(x => x.name == name))];
- }
- return null;
+ return ModLocations.FirstOrDefault(n => n.name == name);
}
public static SGameLocation LoadOrCreateSGameLocationFromName(String name)