Add a Utility class and update command interface.
This commit is contained in:
@@ -17,21 +17,21 @@ namespace OpenRA.Mods.D2k.UtilityCommands
|
||||
{
|
||||
class ImportD2kMapCommand : IUtilityCommand
|
||||
{
|
||||
public string Name { get { return "--import-d2k-map"; } }
|
||||
string IUtilityCommand.Name { get { return "--import-d2k-map"; } }
|
||||
|
||||
public bool ValidateArguments(string[] args)
|
||||
bool IUtilityCommand.ValidateArguments(string[] args)
|
||||
{
|
||||
return args.Length >= 3;
|
||||
}
|
||||
|
||||
[Desc("FILENAME", "TILESET", "Convert a legacy Dune 2000 MAP file to the OpenRA format.")]
|
||||
public void 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;
|
||||
Game.ModData = utility.ModData;
|
||||
|
||||
var rules = Ruleset.LoadDefaultsForTileSet(modData, "ARRAKIS");
|
||||
var map = D2kMapImporter.Import(args[1], modData.Manifest.Mod.Id, args[2], rules);
|
||||
var rules = Ruleset.LoadDefaultsForTileSet(utility.ModData, "ARRAKIS");
|
||||
var map = D2kMapImporter.Import(args[1], utility.ModData.Manifest.Mod.Id, args[2], rules);
|
||||
|
||||
if (map == null)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user