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

@@ -18,14 +18,14 @@ namespace OpenRA.Mods.Common.UtilityCommands
{
public class ResizeMapCommand : IUtilityCommand
{
public string Name { get { return "--resize-map"; } }
string IUtilityCommand.Name { get { return "--resize-map"; } }
int width;
int height;
Map map;
public bool ValidateArguments(string[] args)
bool IUtilityCommand.ValidateArguments(string[] args)
{
if (args.Length < 4)
return false;
@@ -46,9 +46,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
[Desc("MAPFILE", "WIDTH", "HEIGHT", "Resize the map at the bottom corners.")]
public void Run(ModData modData, string[] args)
void IUtilityCommand.Run(Utility utility, string[] args)
{
Game.ModData = modData;
var modData = Game.ModData = utility.ModData;
map = new Map(modData, modData.ModFiles.OpenPackage(args[1], new Folder(".")));
Console.WriteLine("Resizing map {0} from {1} to {2},{3}", map.Title, map.MapSize, width, height);
map.Resize(width, height);