Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public CommandHandler()
 {
     availableCommands = new AttackState();
 }
 public CommandHandler()
 {
     availableCommands = new MovementState();
 }