Make the IsCreate/IsDelete etc methods of the Command class public (Thanks Goodly)

This commit is contained in:
UnknownShadow200 2023-10-22 17:27:28 +11:00
parent 81785236da
commit 9d40e99695
25 changed files with 54 additions and 55 deletions

View File

@ -51,7 +51,7 @@ namespace MCGalaxy.Commands.Bots
string bot = args[1], value = args.Length > 2 ? args[2] : null; string bot = args[1], value = args.Length > 2 ? args[2] : null;
if (args[0].CaselessEq("add")) { if (args[0].CaselessEq("add")) {
AddBot(p, bot); AddBot(p, bot);
} else if (IsDeleteCommand(args[0])) { } else if (IsDeleteAction(args[0])) {
RemoveBot(p, bot, value); RemoveBot(p, bot, value);
} else if (args[0].CaselessEq("text")) { } else if (args[0].CaselessEq("text")) {
SetBotText(p, bot, value, data.Rank); SetBotText(p, bot, value, data.Rank);

View File

@ -33,7 +33,7 @@ namespace MCGalaxy.Commands.Bots
public override void Use(Player p, string message, CommandData data) { public override void Use(Player p, string message, CommandData data) {
string[] args = message.SplitSpaces(); string[] args = message.SplitSpaces();
string cmd = args[0]; string cmd = args[0];
if (IsListCommand(cmd)) { if (IsListAction(cmd)) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
HandleList(p, modifier); HandleList(p, modifier);
return; return;
@ -45,11 +45,11 @@ namespace MCGalaxy.Commands.Bots
if (!Formatter.ValidFilename(p, ai)) return; if (!Formatter.ValidFilename(p, ai)) return;
if (ai == "hunt" || ai == "kill") { p.Message("Reserved for special AI."); return; } if (ai == "hunt" || ai == "kill") { p.Message("Reserved for special AI."); return; }
if (IsCreateCommand(cmd)) { if (IsCreateAction(cmd)) {
HandleAdd(p, ai, args); HandleAdd(p, ai, args);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
HandleDelete(p, ai, args); HandleDelete(p, ai, args);
} else if (IsInfoCommand(cmd)) { } else if (IsInfoAction(cmd)) {
HandleInfo(p, ai); HandleInfo(p, ai);
} else { } else {
Help(p); Help(p);

View File

@ -32,13 +32,13 @@ namespace MCGalaxy.Commands.CPE
if (message.Length == 0) { Help(p); return; } if (message.Length == 0) { Help(p); return; }
string cmd = args[0]; string cmd = args[0];
if (IsCreateCommand(cmd)) { if (IsCreateAction(cmd)) {
AddHandler(p, args); AddHandler(p, args);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
RemoveHandler(p, args); RemoveHandler(p, args);
} else if (IsEditCommand(cmd)) { } else if (IsEditAction(cmd)) {
EditHandler(p, args); EditHandler(p, args);
} else if (IsListCommand(cmd)) { } else if (IsListAction(cmd)) {
string modifer = args.Length > 1 ? args[1] : ""; string modifer = args.Length > 1 ? args[1] : "";
ListHandler(p, "ccols list", modifer); ListHandler(p, "ccols list", modifer);
} else { } else {

View File

@ -53,7 +53,7 @@ namespace MCGalaxy.Commands.Chatting
Toggle(p, ref p.Ignores.DrawOutput, "{0} ignoring draw command output"); return; Toggle(p, ref p.Ignores.DrawOutput, "{0} ignoring draw command output"); return;
} else if (action == "worldchanges") { } else if (action == "worldchanges") {
Toggle(p, ref p.Ignores.WorldChanges, "{0} ignoring world changes"); return; Toggle(p, ref p.Ignores.WorldChanges, "{0} ignoring world changes"); return;
} else if (IsListCommand(action)) { } else if (IsListAction(action)) {
p.Ignores.Output(p); return; p.Ignores.Output(p); return;
} }

View File

@ -48,7 +48,7 @@ namespace MCGalaxy.Commands.Chatting
{ {
Output(p, i + 1, entries[i]); Output(p, i + 1, entries[i]);
} }
} else if (IsDeleteCommand(args[0])) { } else if (IsDeleteAction(args[0])) {
if (args.Length == 1) { if (args.Length == 1) {
p.Message("You need to provide either \"all\" or a number."); return; p.Message("You need to provide either \"all\" or a number."); return;
} else if (args[1].CaselessEq("all")) { } else if (args[1].CaselessEq("all")) {

View File

@ -84,25 +84,25 @@ namespace MCGalaxy
return str.CaselessEq("all") || int.TryParse(str, out ignored); return str.CaselessEq("all") || int.TryParse(str, out ignored);
} }
protected internal static bool IsCreateCommand(string str) { public static bool IsCreateAction(string str) {
return str.CaselessEq("create") || str.CaselessEq("add") || str.CaselessEq("new"); return str.CaselessEq("create") || str.CaselessEq("add") || str.CaselessEq("new");
} }
protected internal static bool IsDeleteCommand(string str) { public static bool IsDeleteAction(string str) {
return str.CaselessEq("del") || str.CaselessEq("delete") || str.CaselessEq("remove"); return str.CaselessEq("del") || str.CaselessEq("delete") || str.CaselessEq("remove");
} }
protected internal static bool IsEditCommand(string str) { public static bool IsEditAction(string str) {
return str.CaselessEq("edit") || str.CaselessEq("change") || str.CaselessEq("modify") return str.CaselessEq("edit") || str.CaselessEq("change") || str.CaselessEq("modify")
|| str.CaselessEq("move") || str.CaselessEq("update"); || str.CaselessEq("move") || str.CaselessEq("update");
} }
protected internal static bool IsInfoCommand(string str) { public static bool IsInfoAction(string str) {
return str.CaselessEq("about") || str.CaselessEq("info") || str.CaselessEq("status") return str.CaselessEq("about") || str.CaselessEq("info") || str.CaselessEq("status")
|| str.CaselessEq("check"); || str.CaselessEq("check");
} }
protected internal static bool IsListCommand(string str) { public static bool IsListAction(string str) {
return str.CaselessEq("list") || str.CaselessEq("view"); return str.CaselessEq("list") || str.CaselessEq("view");
} }
} }

View File

@ -29,7 +29,7 @@ namespace MCGalaxy.Commands.Fun {
RoundsGame game = Game; RoundsGame game = Game;
if (message.CaselessEq("go")) { if (message.CaselessEq("go")) {
HandleGo(p, game); return; HandleGo(p, game); return;
} else if (IsInfoCommand(message)) { } else if (IsInfoAction(message)) {
HandleStatus(p, game); return; HandleStatus(p, game); return;
} }
if (!CheckExtraPerm(p, data, 1)) return; if (!CheckExtraPerm(p, data, 1)) return;
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands.Fun {
HandleStop(p, game); HandleStop(p, game);
} else if (message.CaselessEq("add")) { } else if (message.CaselessEq("add")) {
RoundsGameConfig.AddMap(p, p.level.name, p.level.Config, game); RoundsGameConfig.AddMap(p, p.level.name, p.level.Config, game);
} else if (IsDeleteCommand(message)) { } else if (IsDeleteAction(message)) {
RoundsGameConfig.RemoveMap(p, p.level.name, p.level.Config, game); RoundsGameConfig.RemoveMap(p, p.level.name, p.level.Config, game);
} else if (message.CaselessStarts("set ") || message.CaselessStarts("setup ")) { } else if (message.CaselessStarts("set ") || message.CaselessStarts("setup ")) {
HandleSet(p, game, message.SplitSpaces()); HandleSet(p, game, message.SplitSpaces());

View File

@ -41,13 +41,13 @@ namespace MCGalaxy.Commands.Moderation {
Directory.CreateDirectory("extra/reported"); Directory.CreateDirectory("extra/reported");
string cmd = args[0]; string cmd = args[0];
if (IsListCommand(cmd)) { if (IsListAction(cmd)) {
HandleList(p, args, data); HandleList(p, args, data);
} else if (cmd.CaselessEq("clear")) { } else if (cmd.CaselessEq("clear")) {
HandleClear(p, args, data); HandleClear(p, args, data);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
HandleDelete(p, args, data); HandleDelete(p, args, data);
} else if (IsInfoCommand(cmd)) { } else if (IsInfoAction(cmd)) {
HandleCheck(p, args, data); HandleCheck(p, args, data);
} else { } else {
HandleAdd(p, args); HandleAdd(p, args);

View File

@ -38,7 +38,7 @@ namespace MCGalaxy.Commands.Moderation {
public override void Use(Player p, string message, CommandData data) { public override void Use(Player p, string message, CommandData data) {
if (message.Length == 0 || message.CaselessEq("enter")) { if (message.Length == 0 || message.CaselessEq("enter")) {
HandleEnter(p, data); HandleEnter(p, data);
} else if (IsListCommand(message)) { } else if (IsListAction(message)) {
HandleView(p, data); HandleView(p, data);
} else if (message.CaselessEq("leave")) { } else if (message.CaselessEq("leave")) {
HandleLeave(p); HandleLeave(p);

View File

@ -32,11 +32,11 @@ namespace MCGalaxy.Commands.Moderation {
if (args.Length >= 3) { if (args.Length >= 3) {
Assign(p, args, data); Assign(p, args, data);
} else if (IsListCommand(cmd)) { } else if (IsListAction(cmd)) {
List(p); List(p);
} else if (IsDeleteCommand(cmd) && args.Length > 1) { } else if (IsDeleteAction(cmd) && args.Length > 1) {
Delete(p, args[1], data); Delete(p, args[1], data);
} else if (IsInfoCommand(cmd) && args.Length > 1) { } else if (IsInfoAction(cmd) && args.Length > 1) {
Info(p, args[1]); Info(p, args[1]);
} else { } else {
Help(p); Help(p);

View File

@ -28,13 +28,13 @@ namespace MCGalaxy.Commands.Moderation {
string[] args = message.SplitSpaces(); string[] args = message.SplitSpaces();
string cmd = args[0]; string cmd = args[0];
if (IsCreateCommand(cmd)) { if (IsCreateAction(cmd)) {
if (args.Length < 2) { Help(p); return; } if (args.Length < 2) { Help(p); return; }
Add(p, args[1]); Add(p, args[1]);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
if (args.Length < 2) { Help(p); return; } if (args.Length < 2) { Help(p); return; }
Remove(p, args[1]); Remove(p, args[1]);
} else if (IsListCommand(cmd)) { } else if (IsListAction(cmd)) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
List(p, modifier); List(p, modifier);
} else if (args.Length == 1) { } else if (args.Length == 1) {

View File

@ -43,10 +43,10 @@ namespace MCGalaxy.Commands.Moderation {
if (cmd.CaselessEq("add")) { if (cmd.CaselessEq("add")) {
if (args.Length < 2) { Help(p); return; } if (args.Length < 2) { Help(p); return; }
Add(p, args[1]); Add(p, args[1]);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
if (args.Length < 2) { Help(p); return; } if (args.Length < 2) { Help(p); return; }
Remove(p, args[1]); Remove(p, args[1]);
} else if (IsListCommand(cmd)) { } else if (IsListAction(cmd)) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
List(p, modifier); List(p, modifier);
} else if (args.Length == 1) { } else if (args.Length == 1) {

View File

@ -40,10 +40,10 @@ namespace MCGalaxy.Commands.Moderation {
if (message.Length == 0) { Help(p); return; } if (message.Length == 0) { Help(p); return; }
string opt = args[0]; string opt = args[0];
if (IsCreateCommand(opt)) { if (IsCreateAction(opt)) {
if (args.Length == 1) { Help(p); return; } if (args.Length == 1) { Help(p); return; }
CreateZone(p, args, data, 1); CreateZone(p, args, data, 1);
} else if (IsDeleteCommand(opt)) { } else if (IsDeleteAction(opt)) {
if (args.Length == 1) { Help(p); return; } if (args.Length == 1) { Help(p); return; }
DeleteZone(p, args, data); DeleteZone(p, args, data);
} else if (opt.CaselessEq("perbuild") || opt.CaselessEq("set")) { } else if (opt.CaselessEq("perbuild") || opt.CaselessEq("set")) {

View File

@ -363,7 +363,7 @@ namespace MCGalaxy.Commands.World {
UseCommand(p, "ZoneList", ""); UseCommand(p, "ZoneList", "");
} else if (cmd == "ADD") { } else if (cmd == "ADD") {
UseCommand(p, "PerBuild", "+" + name); UseCommand(p, "PerBuild", "+" + name);
} else if (Command.IsDeleteCommand(cmd)) { } else if (Command.IsDeleteAction(cmd)) {
UseCommand(p, "PerBuild", "-" + name); UseCommand(p, "PerBuild", "-" + name);
} else if (cmd == "BLOCK") { } else if (cmd == "BLOCK") {
UseCommand(p, "PerVisit", "-" + name); UseCommand(p, "PerVisit", "-" + name);

View File

@ -34,7 +34,7 @@ namespace MCGalaxy.Commands.Scripting
public override void Use(Player p, string message, CommandData data) { public override void Use(Player p, string message, CommandData data) {
string[] args = message.SplitSpaces(2); string[] args = message.SplitSpaces(2);
if (IsListCommand(args[0])) { if (IsListAction(args[0])) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
p.Message("Loaded plugins:"); p.Message("Loaded plugins:");

View File

@ -114,7 +114,7 @@ namespace MCGalaxy.Commands {
} }
public UsageResult Use(Player p, string message, bool alertNoneFound = true) { public UsageResult Use(Player p, string message, bool alertNoneFound = true) {
string[] args = message.SplitSpaces(2); string[] args = message.SplitExact(2);
string cmd = args[0]; string cmd = args[0];
foreach (SubCommand subCmd in subCommands) foreach (SubCommand subCmd in subCommands)
@ -122,8 +122,7 @@ namespace MCGalaxy.Commands {
if (!subCmd.Match(cmd)) { continue; } if (!subCmd.Match(cmd)) { continue; }
if (!subCmd.Allowed(p, parentCommandName)) { return UsageResult.Disallowed; } if (!subCmd.Allowed(p, parentCommandName)) { return UsageResult.Disallowed; }
string value = args.Length > 1 ? args[1] : ""; subCmd.behavior(p, args[1]);
subCmd.behavior(p, value);
return UsageResult.Success; return UsageResult.Success;
} }

View File

@ -34,7 +34,7 @@ namespace MCGalaxy.Commands.World {
BlockProps[] scope = GetScope(p, data, args[0]); BlockProps[] scope = GetScope(p, data, args[0]);
if (scope == null) return; if (scope == null) return;
if (IsListCommand(args[1]) && (args.Length == 2 || IsListModifier(args[2]))) { if (IsListAction(args[1]) && (args.Length == 2 || IsListModifier(args[2]))) {
ListProps(p, scope, args); return; ListProps(p, scope, args); return;
} }
@ -45,7 +45,7 @@ namespace MCGalaxy.Commands.World {
if (opt.CaselessEq("copy")) { if (opt.CaselessEq("copy")) {
CopyProps(p, scope, block, args); CopyProps(p, scope, block, args);
} else if (opt.CaselessEq("reset") || IsDeleteCommand(opt)) { } else if (opt.CaselessEq("reset") || IsDeleteAction(opt)) {
ResetProps(p, scope, block); ResetProps(p, scope, block);
} else { } else {
SetProps(p, scope, block, args); SetProps(p, scope, block, args);

View File

@ -46,7 +46,7 @@ namespace MCGalaxy.Commands.World {
if (cmd.Length == 0) { Help(p); return; } if (cmd.Length == 0) { Help(p); return; }
bool checkExtraPerms = warps == WarpList.Global; bool checkExtraPerms = warps == WarpList.Global;
if (IsListCommand(cmd)) { if (IsListAction(cmd)) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
Paginator.Output(p, warps.Items, PrintWarp, Paginator.Output(p, warps.Items, PrintWarp,
group + " list", group + "s", modifier); group + " list", group + "s", modifier);
@ -58,20 +58,20 @@ namespace MCGalaxy.Commands.World {
} }
string name = args[1]; string name = args[1];
if (IsCreateCommand(cmd)) { if (IsCreateAction(cmd)) {
if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return; if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return;
if (warps.Exists(name)) { p.Message("{0} already exists", group); return; } if (warps.Exists(name)) { p.Message("{0} already exists", group); return; }
warps.Create(name, p); warps.Create(name, p);
p.Message("{0} {1} created.", group, name); p.Message("{0} {1} created.", group, name);
} else if (IsDeleteCommand(cmd)) { } else if (IsDeleteAction(cmd)) {
if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return; if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return;
Warp warp = Matcher.FindWarps(p, warps, name); Warp warp = Matcher.FindWarps(p, warps, name);
if (warp == null) return; if (warp == null) return;
warps.Remove(warp, p); warps.Remove(warp, p);
p.Message("{0} {1} deleted.", group, warp.Name); p.Message("{0} {1} deleted.", group, warp.Name);
} else if (IsEditCommand(cmd)) { } else if (IsEditAction(cmd)) {
if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return; if (checkExtraPerms && !CheckExtraPerm(p, data, 1)) return;
Warp warp = Matcher.FindWarps(p, warps, name); Warp warp = Matcher.FindWarps(p, warps, name);
if (warp == null) return; if (warp == null) return;

View File

@ -39,7 +39,7 @@ namespace MCGalaxy.Commands.Building
string[] args = message.SplitSpaces(2); string[] args = message.SplitSpaces(2);
BrushFactory brush = BrushFactory.Find(args[0]); BrushFactory brush = BrushFactory.Find(args[0]);
if (IsListCommand(args[0])) { if (IsListAction(args[0])) {
BrushFactory.List(p); BrushFactory.List(p);
} else if (brush == null) { } else if (brush == null) {
p.Message("No brush found with name \"{0}\".", args[0]); p.Message("No brush found with name \"{0}\".", args[0]);

View File

@ -56,7 +56,7 @@ namespace MCGalaxy.Commands.Building
if (!Formatter.ValidFilename(p, parts[1])) return; if (!Formatter.ValidFilename(p, parts[1])) return;
LoadCopy(p, parts[1]); LoadCopy(p, parts[1]);
} else if (IsDeleteCommand(opt)) { } else if (IsDeleteAction(opt)) {
if (parts.Length != 2) { Help(p); return; } if (parts.Length != 2) { Help(p); return; }
if (!Formatter.ValidFilename(p, parts[1])) return; if (!Formatter.ValidFilename(p, parts[1])) return;
@ -64,7 +64,7 @@ namespace MCGalaxy.Commands.Building
if (path == null) { p.Message("No such copy exists."); return; } if (path == null) { p.Message("No such copy exists."); return; }
File.Delete(path); File.Delete(path);
p.Message("Deleted copy " + parts[1]); p.Message("Deleted copy " + parts[1]);
} else if (IsListCommand(opt)) { } else if (IsListAction(opt)) {
string dir = "extra/savecopy/" + p.name; string dir = "extra/savecopy/" + p.name;
if (!Directory.Exists(dir)) { if (!Directory.Exists(dir)) {
p.Message("You have no saved copies"); return; p.Message("You have no saved copies"); return;

View File

@ -36,7 +36,7 @@ namespace MCGalaxy.Commands.Building {
string[] args = message.SplitSpaces(2); string[] args = message.SplitSpaces(2);
TransformFactory transform = TransformFactory.Find(args[0]); TransformFactory transform = TransformFactory.Find(args[0]);
if (IsListCommand(args[0])) { if (IsListAction(args[0])) {
List(p); List(p);
} else if (transform == null) { } else if (transform == null) {
p.Message("No transform found with name \"{0}\".", args[0]); p.Message("No transform found with name \"{0}\".", args[0]);

View File

@ -115,11 +115,11 @@ namespace MCGalaxy.Eco
LevelPreset preset = FindPreset(args[2]); LevelPreset preset = FindPreset(args[2]);
string cmd = args[1]; string cmd = args[1];
if (Command.IsCreateCommand(cmd)) { if (Command.IsCreateAction(cmd)) {
AddPreset(p, args, preset); AddPreset(p, args, preset);
} else if (Command.IsDeleteCommand(cmd)) { } else if (Command.IsDeleteAction(cmd)) {
RemovePreset(p, args, preset); RemovePreset(p, args, preset);
} else if (Command.IsEditCommand(cmd)) { } else if (Command.IsEditAction(cmd)) {
EditPreset(p, args, preset); EditPreset(p, args, preset);
} else { } else {
OnSetupHelp(p); OnSetupHelp(p);

View File

@ -109,7 +109,7 @@ namespace MCGalaxy.Eco
if (!CommandParser.GetInt(p, args[3], "Price", ref cost, 0)) return; if (!CommandParser.GetInt(p, args[3], "Price", ref cost, 0)) return;
p.Message("&aSet price of rank {0} &ato &f{1} &3{2}", grp.ColoredName, cost, Server.Config.Currency); p.Message("&aSet price of rank {0} &ato &f{1} &3{2}", grp.ColoredName, cost, Server.Config.Currency);
GetOrAdd(grp.Permission).Price = cost; GetOrAdd(grp.Permission).Price = cost;
} else if (Command.IsDeleteCommand(args[1])) { } else if (Command.IsDeleteAction(args[1])) {
Group grp = Matcher.FindRanks(p, args[2]); Group grp = Matcher.FindRanks(p, args[2]);
if (grp == null) return; if (grp == null) return;
if (p.Rank < grp.Permission) { p.Message("&WCannot remove a rank higher than yours."); return; } if (p.Rank < grp.Permission) { p.Message("&WCannot remove a rank higher than yours."); return; }

View File

@ -30,7 +30,7 @@ namespace MCGalaxy.Modules.Awards
string[] args = message.SplitSpaces(2); string[] args = message.SplitSpaces(2);
if (args.Length < 2) { Help(p); return; } if (args.Length < 2) { Help(p); return; }
if (IsCreateCommand(args[0])) { if (IsCreateAction(args[0])) {
args = args[1].Split(awardArgs, 2); args = args[1].Split(awardArgs, 2);
if (args.Length == 1) { if (args.Length == 1) {
p.Message("&WUse a : to separate the award name from its description."); p.Message("&WUse a : to separate the award name from its description.");
@ -46,7 +46,7 @@ namespace MCGalaxy.Modules.Awards
Chat.MessageGlobal("Award added: &6{0} : {1}", award, desc); Chat.MessageGlobal("Award added: &6{0} : {1}", award, desc);
AwardsList.Save(); AwardsList.Save();
} }
} else if (IsDeleteCommand(args[0])) { } else if (IsDeleteAction(args[0])) {
if (!AwardsList.Remove(args[1])) { if (!AwardsList.Remove(args[1])) {
p.Message("This award does not exist."); return; p.Message("This award does not exist."); return;
} else { } else {

View File

@ -207,10 +207,10 @@ namespace MCGalaxy.Modules.Games.TW
List<TWGame.TWZone> zones = noTntZone ? game.tntFreeZones : game.tntImmuneZones; List<TWGame.TWZone> zones = noTntZone ? game.tntFreeZones : game.tntImmuneZones;
string opt = args[3]; string opt = args[3];
if (IsCreateCommand(opt)) { if (IsCreateAction(opt)) {
p.Message("Place 2 blocks to create a {0} zone", type); p.Message("Place 2 blocks to create a {0} zone", type);
p.MakeSelection(2, zones, AddZoneCallback); p.MakeSelection(2, zones, AddZoneCallback);
} else if (IsDeleteCommand(opt)) { } else if (IsDeleteAction(opt)) {
if (args.Length > 4 && args[4].CaselessEq("all")) { if (args.Length > 4 && args[4].CaselessEq("all")) {
zones.Clear(); zones.Clear();
p.Message("Deleted all {0} zones", type); p.Message("Deleted all {0} zones", type);