me.armar.plugins.autorank.playerchecker.requirement
Class LocationRequirement

java.lang.Object
  extended by me.armar.plugins.autorank.playerchecker.requirement.Requirement
      extended by me.armar.plugins.autorank.playerchecker.requirement.LocationRequirement

public class LocationRequirement
extends Requirement


Field Summary
private  boolean autoComplete
           
private  boolean optional
           
private  int radius
           
private  int reqId
           
(package private)  java.util.List<Result> results
           
private  java.lang.String world
           
private  int xLocation
           
private  int yLocation
           
private  int zLocation
           
 
Constructor Summary
LocationRequirement()
           
 
Method Summary
 java.lang.String getDescription()
          Gets the description of the requirement Make sure this is always a translatable message.
 java.lang.String getProgress(org.bukkit.entity.Player player)
          Gets the current progress of a player on a certain requirement.
 int getReqId()
          Get the id of this requirement.
 java.util.List<Result> getResults()
          Gets the results when this requirement is finished
 boolean isOptional()
          Is this an optional requirement?
 boolean meetsRequirement(org.bukkit.entity.Player player)
          Does it meet the requirements?
 boolean setOptions(java.lang.String[] options, boolean optional, java.util.List<Result> results, boolean autoComplete, int reqId)
          Setup requirement specific objects.
 boolean useAutoCompletion()
          Use auto completion for this?
 
Methods inherited from class me.armar.plugins.autorank.playerchecker.requirement.Requirement
getAutorank, isCompleted, setAutorank, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xLocation

private int xLocation

yLocation

private int yLocation

zLocation

private int zLocation

world

private java.lang.String world

radius

private int radius

optional

private boolean optional

autoComplete

private boolean autoComplete

reqId

private int reqId

results

java.util.List<Result> results
Constructor Detail

LocationRequirement

public LocationRequirement()
Method Detail

setOptions

public boolean setOptions(java.lang.String[] options,
                          boolean optional,
                          java.util.List<Result> results,
                          boolean autoComplete,
                          int reqId)
Description copied from class: Requirement
Setup requirement specific objects. This method is called when Autorank sets up its config. The requirement id, auto completion and optional values are assigned automatically.

Specified by:
setOptions in class Requirement
Parameters:
options - String[] containing values of the config
optional - Is this an optional requirement?
results - List containing results
autoComplete - Will this auto complete?
reqId - id of the requirement
Returns:

meetsRequirement

public boolean meetsRequirement(org.bukkit.entity.Player player)
Description copied from class: Requirement
Does it meet the requirements? This method gets called when someone does /ar check or /ar complete. It should always contain the following line:

if (isCompleted(getReqId(), player.getName())) { return true; }

Specified by:
meetsRequirement in class Requirement
Parameters:
player - Player to check for
Returns:
true if it meets the requirements; false otherwise

getDescription

public java.lang.String getDescription()
Description copied from class: Requirement
Gets the description of the requirement Make sure this is always a translatable message.

Specified by:
getDescription in class Requirement
Returns:
string containing description (in locale language)

isOptional

public boolean isOptional()
Description copied from class: Requirement
Is this an optional requirement? (Not a main requirement)

Specified by:
isOptional in class Requirement
Returns:
true when optional; false otherwise.

getResults

public java.util.List<Result> getResults()
Description copied from class: Requirement
Gets the results when this requirement is finished

Specified by:
getResults in class Requirement
Returns:
A list of results that has to be done.

getProgress

public java.lang.String getProgress(org.bukkit.entity.Player player)
Description copied from class: Requirement
Gets the current progress of a player on a certain requirement.

Specified by:
getProgress in class Requirement
Parameters:
player - Player to check for
Returns:
String containing the progress

useAutoCompletion

public boolean useAutoCompletion()
Description copied from class: Requirement
Use auto completion for this?

Specified by:
useAutoCompletion in class Requirement
Returns:
true when auto complete; false otherwise

getReqId

public int getReqId()
Description copied from class: Requirement
Get the id of this requirement. This should get assigned automatically at setOptions(). The id should always be dynamic.

Specified by:
getReqId in class Requirement
Returns:
id