public bool CommandPassesRules(IGettingReadyCommand command) { var rulesForCommand = rules.Where(rule => rule.AppliesToCommand(command)); foreach (var rule in rulesForCommand) { if (!rule.Evaluate(command.Person, command.WeatherType)) { return(false); // Return early because it failed to pass a rule } } return(true); }
public bool AppliesToCommand(IGettingReadyCommand command) { return(AppliesToCommand(command.GetType())); }