diff options
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractYesNoState.java')
-rw-r--r-- | EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractYesNoState.java | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractYesNoState.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractYesNoState.java deleted file mode 100644 index 67baf6bb6..000000000 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractYesNoState.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.earth2me.essentials.update.states; - - -public abstract class AbstractYesNoState extends AbstractState -{ - private boolean answer = false; - private final transient Class<? extends AbstractState> yesState; - private final transient Class<? extends AbstractState> noState; - - public AbstractYesNoState(final StateMap states, final Class<? extends AbstractState> nextState) - { - this(states, nextState, nextState); - } - - public AbstractYesNoState(final StateMap states, final Class<? extends AbstractState> yesState, final Class<? extends AbstractState> noState) - { - super(states); - this.yesState = yesState; - this.noState = noState; - } - - @Override - public AbstractState getNextState() - { - return answer - ? (yesState == null ? null : getState(yesState)) - : (noState == null ? null : getState(noState)); - } - - @Override - public boolean reactOnAnswer(final String answer) - { - if (answer.equalsIgnoreCase("yes") - || answer.equalsIgnoreCase("y")) - { - this.answer = true; - return true; - } - if (answer.equalsIgnoreCase("no") - || answer.equalsIgnoreCase("n")) - { - this.answer = false; - return true; - } - return false; - } - - public boolean getAnswer() - { - return answer; - } - - protected void setAnswer(final boolean answer) - { - this.answer = answer; - } -} |