mirror of https://github.com/PikaMug/Quests.git
53 lines
1.9 KiB
Java
53 lines
1.9 KiB
Java
/*
|
|
* Copyright (c) PikaMug and contributors
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
|
|
package me.pikamug.quests.convo.conditions;
|
|
|
|
import me.pikamug.quests.Quests;
|
|
import me.pikamug.quests.conditions.ConditionFactory;
|
|
import me.pikamug.quests.convo.QuestsNumericPrompt;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.conversations.ConversationContext;
|
|
|
|
public abstract class ConditionsEditorNumericPrompt extends QuestsNumericPrompt {
|
|
private final ConversationContext context;
|
|
private ConditionFactory factory;
|
|
|
|
public ConditionsEditorNumericPrompt(final ConversationContext context) {
|
|
this.context = context;
|
|
if (context != null && context.getPlugin() != null) {
|
|
this.factory = ((Quests)context.getPlugin()).getConditionFactory();
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return getClass().getSimpleName();
|
|
}
|
|
|
|
public ConversationContext getConversationContext() {
|
|
return context;
|
|
}
|
|
|
|
public ConditionFactory getConditionFactory() {
|
|
return factory;
|
|
}
|
|
|
|
public abstract int getSize();
|
|
|
|
public abstract String getTitle(ConversationContext context);
|
|
|
|
public abstract ChatColor getNumberColor(ConversationContext context, int number);
|
|
|
|
public abstract String getSelectionText(ConversationContext context, int number);
|
|
|
|
public abstract String getAdditionalText(ConversationContext context, int number);
|
|
}
|