Don't expose extensions in BaseAbilityBot

This commit is contained in:
Christian Blos 2020-10-08 15:46:31 +02:00
parent b715f2a154
commit 247ca5f984

View File

@ -106,7 +106,7 @@ public abstract class BaseAbilityBot extends DefaultAbsSender implements Ability
private final String botUsername;
// Ability registry
protected final List<AbilityExtension> extensions = new ArrayList<>();
private final List<AbilityExtension> extensions = new ArrayList<>();
private Map<String, Ability> abilities;
private Map<String, Stats> stats;
@ -273,6 +273,18 @@ public abstract class BaseAbilityBot extends DefaultAbsSender implements Ability
return false;
}
protected void addExtension(AbilityExtension extension) {
this.extensions.add(extension);
}
protected void addExtensions(AbilityExtension... extensions) {
this.extensions.addAll(Arrays.asList(extensions));
}
protected void addExtensions(Collection<AbilityExtension> extensions) {
this.extensions.addAll(extensions);
}
/**
* Registers the declared abilities using method reflection. Also, replies are accumulated using the built abilities and standalone methods that return a Reply.
* <p>