Add a Utility class and update command interface.

This commit is contained in:
Paul Chote
2016-08-05 18:25:51 +01:00
parent 510555af5c
commit 45a596953e
36 changed files with 157 additions and 148 deletions

View File

@@ -15,16 +15,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
[Desc("ACTOR-TYPE [PATH/TO/MAP]", "Display the finalized, merged MiniYaml tree for the given actor type. Input values are case-sensitive.")]
void IUtilityCommand.Run(ModData modData, string[] args)
void IUtilityCommand.Run(Utility utility, string[] args)
{
// HACK: The engine code assumes that Game.modData is set.
Game.ModData = modData;
var modData = Game.ModData = utility.ModData;
var actorType = args[1];
string mapPath = null;
Map map = null;
if (args.Length == 3)
{
try
{
mapPath = args[2];
@@ -35,6 +36,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
Console.WriteLine("Could not load map '{0}'.", mapPath);
Environment.Exit(2);
}
}
var fs = map ?? modData.DefaultFileSystem;
var topLevelNodes = MiniYaml.Load(fs, modData.Manifest.Rules, map == null ? null : map.RuleDefinitions);