implementing part of Parser class
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
package ch.zhaw.catan;
|
||||
|
||||
import org.beryx.textio.TextIO;
|
||||
|
||||
public enum Command {
|
||||
NEXTPLAYER ("next Player"), QUIT("quit");
|
||||
NEXTPLAYER ("next Player"), QUIT("quit"), UNKNOWN ("unknown");
|
||||
|
||||
private String commandWord;
|
||||
|
||||
|
||||
public static <T extends Enum<T>> T getEnumValue(TextIO textIO, Class<T> commands) {
|
||||
return textIO.newEnumInputReader(commands).read("What would you like to do?");
|
||||
}
|
||||
|
||||
private String CommandWord;
|
||||
|
||||
Command(String commandWord) {
|
||||
this.CommandWord = commandWord;
|
||||
this.commandWord = commandWord;
|
||||
}
|
||||
public String toString() {
|
||||
return commandWord;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user