21 lines
557 B
Java
21 lines
557 B
Java
package game.command;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
|
|
public abstract class CompletingParser extends ArgumentParser {
|
|
private final List<String> defCompletions;
|
|
|
|
public CompletingParser(String name, Object ... completions) {
|
|
super(name);
|
|
this.defCompletions = new ArrayList<String>(completions.length);
|
|
for(Object comp : completions) {
|
|
this.defCompletions.add(String.valueOf(comp));
|
|
}
|
|
}
|
|
|
|
public Collection<String> getCompletions(CommandEnvironment env) {
|
|
return this.defCompletions;
|
|
}
|
|
}
|