summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-09 00:11:39 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-09 00:11:39 -0400
commit486ac29796586e09540723dcae8070cf3e60285b (patch)
tree50b9c473ef8e89f17f631af4b183dcb6379acf74 /src/StardewModdingAPI/Program.cs
parent85f609dc6c2f02d89b9fccaacfe837f8822d6b7c (diff)
downloadSMAPI-486ac29796586e09540723dcae8070cf3e60285b.tar.gz
SMAPI-486ac29796586e09540723dcae8070cf3e60285b.tar.bz2
SMAPI-486ac29796586e09540723dcae8070cf3e60285b.zip
use shared reflection helper
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r--src/StardewModdingAPI/Program.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index 1913544f..aa78ff41 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -15,6 +15,7 @@ using StardewModdingAPI.Events;
using StardewModdingAPI.Framework;
using StardewModdingAPI.Framework.Logging;
using StardewModdingAPI.Framework.Models;
+using StardewModdingAPI.Framework.Reflection;
using StardewModdingAPI.Framework.Serialisation;
using StardewValley;
using Monitor = StardewModdingAPI.Framework.Monitor;
@@ -40,6 +41,9 @@ namespace StardewModdingAPI
/// <summary>Tracks whether the game should exit immediately and any pending initialisation should be cancelled.</summary>
private readonly CancellationTokenSource CancellationTokenSource = new CancellationTokenSource();
+ /// <summary>Simplifies access to private game code.</summary>
+ private readonly IReflectionHelper Reflection = new ReflectionHelper();
+
/// <summary>The underlying game instance.</summary>
private SGame GameInstance;
@@ -141,7 +145,7 @@ namespace StardewModdingAPI
AppDomain.CurrentDomain.UnhandledException += (sender, e) => this.Monitor.Log($"Critical app domain exception: {e.ExceptionObject}", LogLevel.Error);
// override game
- this.GameInstance = new SGame(this.Monitor);
+ this.GameInstance = new SGame(this.Monitor, this.Reflection);
StardewValley.Program.gamePtr = this.GameInstance;
// add exit handler
@@ -599,7 +603,7 @@ namespace StardewModdingAPI
// inject data
// get helper
mod.ModManifest = manifest;
- mod.Helper = new ModHelper(manifest, directory.FullName, jsonHelper, this.ModRegistry, this.CommandManager, (SContentManager)Game1.content);
+ mod.Helper = new ModHelper(manifest, directory.FullName, jsonHelper, this.ModRegistry, this.CommandManager, (SContentManager)Game1.content, this.Reflection);
mod.Monitor = this.GetSecondaryMonitor(manifest.Name);
mod.PathOnDisk = directory.FullName;