added method trade to Parser

This commit is contained in:
Leonardo Brandenberger 2021-12-02 18:07:02 +01:00
parent f65449df56
commit 4748643163
1 changed files with 8 additions and 15 deletions

View File

@ -54,22 +54,15 @@ public class Parser {
}
public Command getAction() {
switch (textIO.newEnumInputReader(Command.class).read("What would you like to do?")) {
case NEXTPLAYER:
return NEXTPLAYER;
case BUILDSETTLEMENT:
return BUILDSETTLEMENT;
case BUILDCITY:
return BUILDCITY;
case BUILDROAD:
return BUILDROAD;
case TRADEWITHBANK:
return TRADEWITHBANK;
case QUIT:
return QUIT;
default:
return null;
return textIO.newEnumInputReader(Command.class).read("What would you like to do?");
}
public Config.Resource trade(boolean give) {
String output = "give";
if (!give){
output = "receive";
}
return textIO.newEnumInputReader(Config.Resource.class).read("Which Resource would you like to " + give );
}
}