public CommandResponse ProcessTurn(String userInput, Player thePlayer) { availableCommands = availableCommands.Update(thePlayer); ParsedInput validInput = parse(userInput); Command theCommand = availableCommands.GetCommand(validInput.Command); if (theCommand == null) return new CommandResponse("Not a valid command"); return theCommand.Execute(validInput, thePlayer); }
public CommandResponse ProcessTurn(String userInput, Player thePlayer) { availableCommands = availableCommands.Update(thePlayer); ParsedInput validInput = parse(userInput); Command theCommand = availableCommands.GetCommand(validInput.Command); if (theCommand == null) { return(new CommandResponse("Not a valid command")); } return(theCommand.Execute(validInput, thePlayer)); }