public bool IsApplicable(CellStateArea cellNeighbors) { return(Operator switch { "not" => !RightCondition.IsApplicable(cellNeighbors), "and" => LeftCondition.IsApplicable(cellNeighbors) && RightCondition.IsApplicable(cellNeighbors), "or" => LeftCondition.IsApplicable(cellNeighbors) || RightCondition.IsApplicable(cellNeighbors), "xor" => LeftCondition.IsApplicable(cellNeighbors) ^ RightCondition.IsApplicable(cellNeighbors), _ => false });
internal override void GenerateConditionString(StringBuilder stringBuilder, Dictionary <string, object> parameters) { stringBuilder.Append("("); LeftCondition.GenerateConditionString(stringBuilder, parameters); stringBuilder.Append(" "); stringBuilder.Append(LogicalOperator.ToString().ToUpper()); stringBuilder.Append(" "); RightCondition.GenerateConditionString(stringBuilder, parameters); stringBuilder.Append(")"); }
public override bool IsSatisfiedBy(TBusinessObject candidate) { return(LeftCondition.IsSatisfiedBy(candidate) && RightCondition.IsSatisfiedBy(candidate)); }