diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-30 18:55:16 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-30 18:55:16 -0400 |
commit | 482a91962ac02cf83c2647fd7e5ba8627bd0bb0b (patch) | |
tree | deb6d10f11185beba973d07e9510f790588071dc /src/StardewModdingAPI/Context.cs | |
parent | 22806ab900721a61b142937bc58dd33727d377f9 (diff) | |
parent | d4f172fef160d277d5161d96a26d5174e6fc14ca (diff) | |
download | SMAPI-482a91962ac02cf83c2647fd7e5ba8627bd0bb0b.tar.gz SMAPI-482a91962ac02cf83c2647fd7e5ba8627bd0bb0b.tar.bz2 SMAPI-482a91962ac02cf83c2647fd7e5ba8627bd0bb0b.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Context.cs')
-rw-r--r-- | src/StardewModdingAPI/Context.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Context.cs b/src/StardewModdingAPI/Context.cs new file mode 100644 index 00000000..415b4aac --- /dev/null +++ b/src/StardewModdingAPI/Context.cs @@ -0,0 +1,20 @@ +using StardewValley; + +namespace StardewModdingAPI +{ + /// <summary>Provides information about the current game state.</summary> + internal static class Context + { + /********* + ** Accessors + *********/ + /// <summary>Whether a player save has been loaded.</summary> + public static bool IsSaveLoaded => Game1.hasLoadedGame && !string.IsNullOrEmpty(Game1.player.name); + + /// <summary>Whether the game is currently writing to the save file.</summary> + public static bool IsSaving => SaveGame.IsProcessing; + + /// <summary>Whether the game is currently running the draw loop.</summary> + public static bool IsInDrawLoop { get; set; } + } +} |