2025-03-11 00:23:54 +01:00
|
|
|
package game.command;
|
|
|
|
|
2025-03-26 13:27:17 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
|
2025-03-11 00:23:54 +01:00
|
|
|
public abstract class CompletingParser extends ArgumentParser {
|
2025-03-26 13:27:17 +01:00
|
|
|
private final List<String> defCompletions;
|
2025-03-11 00:23:54 +01:00
|
|
|
|
|
|
|
public CompletingParser(String name, Object ... completions) {
|
|
|
|
super(name);
|
2025-03-26 13:27:17 +01:00
|
|
|
this.defCompletions = new ArrayList<String>(completions.length);
|
|
|
|
for(Object comp : completions) {
|
|
|
|
this.defCompletions.add(String.valueOf(comp));
|
2025-03-11 00:23:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-03-26 13:27:17 +01:00
|
|
|
public Collection<String> getCompletions(CommandEnvironment env) {
|
2025-03-11 00:23:54 +01:00
|
|
|
return this.defCompletions;
|
|
|
|
}
|
|
|
|
}
|