diff options
author | ClxS <slxxls92@gmail.com> | 2016-03-04 22:21:16 +0000 |
---|---|---|
committer | ClxS <slxxls92@gmail.com> | 2016-03-04 22:21:16 +0000 |
commit | ed3bf29600d3e8e7cb88629bfe6da9db6339c6a8 (patch) | |
tree | 495eae3079f5886f2117a2ed5bf425a1e141aa65 /StardewModdingAPI/Inheritance | |
parent | b8a9f8fc88706896c3191b80d17375a483183226 (diff) | |
download | SMAPI-ed3bf29600d3e8e7cb88629bfe6da9db6339c6a8.tar.gz SMAPI-ed3bf29600d3e8e7cb88629bfe6da9db6339c6a8.tar.bz2 SMAPI-ed3bf29600d3e8e7cb88629bfe6da9db6339c6a8.zip |
A few small clean ups and removed a lot of the readme until I think of what to put there
Diffstat (limited to 'StardewModdingAPI/Inheritance')
-rw-r--r-- | StardewModdingAPI/Inheritance/SGame.cs | 13 |
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)
|