Made 9p command variable names consistent with the data object.

This commit is contained in:
Harrison Deng 2019-03-07 23:08:15 -06:00
parent 238cdbde71
commit 38083a1e2f

View File

@ -23,8 +23,8 @@ namespace RecrownedAthenaeum.Tools.NinePatchTools
commandArguments[1] = new EngineCommandArgument("-o", "defines path of output file.");
commandArguments[2] = new EngineCommandArgument("-l", "left patch.", true);
commandArguments[3] = new EngineCommandArgument("-r", "right patch.", true);
commandArguments[4] = new EngineCommandArgument("-u", "up patch.", true);
commandArguments[5] = new EngineCommandArgument("-d", "down patch.", true);
commandArguments[4] = new EngineCommandArgument("-t", "top patch.", true);
commandArguments[5] = new EngineCommandArgument("-b", "bottom patch.", true);
}
public override void Run(string[] arguments = null)
@ -44,9 +44,9 @@ namespace RecrownedAthenaeum.Tools.NinePatchTools
outPath = imagePath.Substring(0, imagePath.Length - Path.GetExtension(imagePath).Length);
}
if (IndexOfArgument("-l", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-l", arguments) + 1], out leftBound)) throw new ArgumentException("Missing -l argument bound.");
if (IndexOfArgument("-r", arguments) + 1 >= arguments.Length || !Int32.TryParse(arguments[IndexOfArgument("-r", arguments) + 1], out rightBound)) throw new ArgumentException("Missing -r argument bound.");
if (IndexOfArgument("-u", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-u", arguments) + 1], out topBound)) throw new ArgumentException("Missing -u argument bound.");
if (IndexOfArgument("-d", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-d", arguments) + 1], out bottomBound)) throw new ArgumentException("Missing -d argument bound.");
if (IndexOfArgument("-r", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-r", arguments) + 1], out rightBound)) throw new ArgumentException("Missing -r argument bound.");
if (IndexOfArgument("-t", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-t", arguments) + 1], out topBound)) throw new ArgumentException("Missing -u argument bound.");
if (IndexOfArgument("-b", arguments) + 1 >= arguments.Length || !int.TryParse(arguments[IndexOfArgument("-b", arguments) + 1], out bottomBound)) throw new ArgumentException("Missing -d argument bound.");
NinePatchData npData = new NinePatchData(Path.GetFileName(imagePath), leftBound, rightBound, bottomBound, topBound);
string serialized = JsonConvert.SerializeObject(npData, Formatting.Indented);