#315 #305 Refactor HelpProvider - add bit flags, reduce duplication (wip)

This commit is contained in:
ljacqu
2015-12-12 22:50:07 +01:00
parent d26cbfbd14
commit 01cba2a508
4 changed files with 242 additions and 118 deletions
@@ -65,7 +65,7 @@ public class CommandDescription {
}
/**
* Create an instance for internal use.
* Create an instance.
*
* @param labels List of command labels.
* @param description Command description.
@@ -108,7 +108,7 @@ public class CommandDescription {
* @return All relative labels.
*/
public List<String> getLabels() {
return this.labels;
return labels;
}
/**
@@ -145,23 +145,34 @@ public class CommandDescription {
return parent;
}
/**
* Return the number of parents that precede the command description.
*
* @return The number of parents, e.g. for "/authme abc def" the parent count is 2 ("/authme abc", "/authme")
*/
public int getParentCount() {
if (parent == null) {
return 0;
}
return parent.getParentCount() + 1;
}
/**
* Return all command children.
*
* @return Command children.
*/
public List<CommandDescription> getChildren() {
return this.children;
return children;
}
/**
* Return all arguments the command takes.
*
* @return Command arguments.
*/
public List<CommandArgumentDescription> getArguments() {
return this.arguments;
return arguments;
}
/**
@@ -182,14 +193,13 @@ public class CommandDescription {
return detailedDescription;
}
/**
* Return the permissions required to execute the command.
*
* @return The command permissions, or null if none are required to execute the command.
*/
public CommandPermissions getCommandPermissions() {
return this.permissions;
return permissions;
}
/**