Remove some global state dependence in ActorInfo.

Instead on relying on the global Game.ModData.ObjectCreator, this is passed in via a parameter.
This commit is contained in:
RoosterDragon
2015-11-20 21:21:12 +00:00
committed by Oliver Brakmann
parent c7249e6fa6
commit 0caffa8196
4 changed files with 14 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Widgets;
@@ -38,7 +39,12 @@ namespace OpenRA
{
Languages = new string[0];
Manifest = new Manifest(mod);
ObjectCreator = new ObjectCreator(Manifest);
// Allow mods to load types from the core Game assembly, and any additional assemblies they specify.
var assemblies =
new[] { typeof(Game).Assembly }.Concat(
Manifest.Assemblies.Select(path => Assembly.LoadFrom(Platform.ResolvePath(path))));
ObjectCreator = new ObjectCreator(assemblies);
Manifest.LoadCustomData(ObjectCreator);
if (useLoadScreen)