public bool Execute(char command, IRobotWars robot) { _validate = new ValidateCommand(); if (robot == null || !_validate.IsValid(command)) return false; this.ProcessCommand(command, robot); return true; }
public bool Execute(char command, IRobotWars robot) { _validate = new ValidateCommand(); if (robot == null || !_validate.IsValid(command)) { return(false); } this.ProcessCommand(command, robot); return(true); }
private bool Validate(string command) { command = command.Replace(" ", string.Empty); return(command.All(s => _validation.IsValid(s))); }