diff --git a/src/ch/zhaw/catan/Parser.java b/src/ch/zhaw/catan/Parser.java index 5507656..eb15669 100644 --- a/src/ch/zhaw/catan/Parser.java +++ b/src/ch/zhaw/catan/Parser.java @@ -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 ); } }