diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/Comparable.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/Comparable.java index 025f612887..8d2ac2598d 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/Comparable.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/Comparable.java @@ -6,6 +6,37 @@ public class Comparable { + // TODO: Expand upon this. + // + // <--[language] + // @name Comparable + // @group Comparables + // @description + // A Comparable is a method that the IF command and Element dObject uses to compare objects. + // --> + + // <--[language] + // @name Operator + // @group Comparables + // @description + // An operator is the type of comparison that a comparable will check. Not all types of + // comparables are compatible with all operators. See '!lang comparable' for more information. + // + // Available Operators include: + // EQUALS (==), MATCHES, OR_MORE (>=), OR_LESS (<=), MORE (>), LESS (<), CONTAINS, and IS_EMPTY. + // + // Operators which have a symbol alternative (as marked by parenthesis) can be referred to by either + // their name or symbol. Using a '!' in front of the operator will also reverse logic, effectively + // turning 'EQUALS' into 'DOES NOT EQUAL', for example. + // + // Note: When using an operator in a replaceable tag (such as ), + // keep in mind that < and >, and even >= and <= must be either escaped, or referred to by name. + // Example: can alternatively be will produce undesired results. <>'s must be escaped since + // they are normally notation for a replaceable tag. Escaping is not necessary when the argument + // contains no replaceable tags. + // + // --> public static enum Operator { EQUALS, MATCHES, OR_MORE, OR_LESS, MORE, LESS, CONTAINS, IS_EMPTY @@ -32,6 +63,11 @@ public void setNegativeLogic() { } + public void setOperator(Operator operator) { + this.operator = operator; + } + + public void setComparable(String arg) { // If a Number