Skip to content

Commit a51ee0b

Browse files
committed
Cleanup
1 parent 8270d26 commit a51ee0b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Source/Orts.Simulation/Common/Scripting/ScriptManager.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,23 @@ namespace Orts.Common.Scripting
3333
[CallOnThread("Loader")]
3434
public class ScriptManager
3535
{
36-
readonly Simulator Simulator;
3736
readonly IDictionary<string, Assembly> Scripts = new Dictionary<string, Assembly>();
3837
static readonly string[] ReferenceAssemblies = new[]
3938
{
40-
typeof(System.Object).GetTypeInfo().Assembly.Location,
41-
typeof(System.Diagnostics.Debug).GetTypeInfo().Assembly.Location,
42-
typeof(ORTS.Common.ElapsedTime).GetTypeInfo().Assembly.Location,
43-
typeof(ORTS.Scripting.Api.Timer).GetTypeInfo().Assembly.Location,
44-
typeof(System.Linq.Enumerable).GetTypeInfo().Assembly.Location,
39+
typeof(System.Object).Assembly.Location,
40+
typeof(System.Diagnostics.Debug).Assembly.Location,
41+
typeof(ORTS.Common.ElapsedTime).Assembly.Location,
42+
typeof(ORTS.Scripting.Api.Timer).Assembly.Location,
43+
typeof(System.Linq.Enumerable).Assembly.Location,
4544
};
4645
static MetadataReference[] References = ReferenceAssemblies.Select(r => MetadataReference.CreateFromFile(r)).ToArray();
4746
static CSharpCompilationOptions CompilationOptions = new CSharpCompilationOptions(
4847
OutputKind.DynamicallyLinkedLibrary,
4948
optimizationLevel: Debugger.IsAttached ? OptimizationLevel.Debug : OptimizationLevel.Release);
5049

5150
[CallOnThread("Loader")]
52-
internal ScriptManager(Simulator simulator)
51+
internal ScriptManager()
5352
{
54-
Simulator = simulator;
5553
}
5654

5755
public object Load(string[] pathArray, string name, string nameSpace = "ORTS.Scripting.Script")

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi
354354
Confirmer = new Confirmer(this, 1.5);
355355
HazzardManager = new HazzardManager(this);
356356
FuelManager = new FuelManager(this);
357-
ScriptManager = new ScriptManager(this);
357+
ScriptManager = new ScriptManager();
358358
Log = new CommandLog(this);
359359
}
360360

0 commit comments

Comments
 (0)