예제 #1
0
        public bool Execute(char command, IRobotWars robot)
        {
            _validate = new ValidateCommand();
            if (robot == null || !_validate.IsValid(command))
                return false;
            this.ProcessCommand(command, robot);

            return true;
        }
예제 #2
0
        public bool Execute(char command, IRobotWars robot)
        {
            _validate = new ValidateCommand();
            if (robot == null || !_validate.IsValid(command))
            {
                return(false);
            }
            this.ProcessCommand(command, robot);

            return(true);
        }
예제 #3
0
 private bool Validate(string command)
 {
     command = command.Replace(" ", string.Empty);
     return(command.All(s => _validation.IsValid(s)));
 }