added method trade to Parser
This commit is contained in:
		
							parent
							
								
									f65449df56
								
							
						
					
					
						commit
						4748643163
					
				| 
						 | 
				
			
			@ -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 );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue