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() { public Command getAction() {
switch (textIO.newEnumInputReader(Command.class).read("What would you like to do?")) { return textIO.newEnumInputReader(Command.class).read("What would you like to do?");
case NEXTPLAYER: }
return NEXTPLAYER;
case BUILDSETTLEMENT: public Config.Resource trade(boolean give) {
return BUILDSETTLEMENT; String output = "give";
case BUILDCITY: if (!give){
return BUILDCITY; output = "receive";
case BUILDROAD:
return BUILDROAD;
case TRADEWITHBANK:
return TRADEWITHBANK;
case QUIT:
return QUIT;
default:
return null;
} }
return textIO.newEnumInputReader(Config.Resource.class).read("Which Resource would you like to " + give );
} }
} }