コード例 #1
0
ファイル: CommandHandler.cs プロジェクト: Kais120/7201a2
        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);
        }
コード例 #2
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));
        }