From ed3bf29600d3e8e7cb88629bfe6da9db6339c6a8 Mon Sep 17 00:00:00 2001 From: ClxS Date: Fri, 4 Mar 2016 22:21:16 +0000 Subject: A few small clean ups and removed a lot of the readme until I think of what to put there --- StardewModdingAPI/Inheritance/SGame.cs | 13 +++++++---- StardewModdingAPI/StardewModdingAPI.csproj | 37 ++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'StardewModdingAPI') 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) diff --git a/StardewModdingAPI/StardewModdingAPI.csproj b/StardewModdingAPI/StardewModdingAPI.csproj index a223f6c2..d6a3d01c 100644 --- a/StardewModdingAPI/StardewModdingAPI.csproj +++ b/StardewModdingAPI/StardewModdingAPI.csproj @@ -19,9 +19,24 @@ + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true - AnyCPU + x86 true full false @@ -57,9 +72,9 @@ False - D:\Games\steamapps\common\Stardew Valley\Stardew Valley.exe + ..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe False - False + True @@ -72,8 +87,8 @@ False - D:\Games\steamapps\common\Stardew Valley\xTile.dll - False + ..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\xTile.dll + True @@ -108,6 +123,18 @@ + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + -- cgit