Add a Utility class and update command interface.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user