예제 #1
0
 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
     });
예제 #2
0
        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(")");
        }
예제 #3
0
 public override bool IsSatisfiedBy(TBusinessObject candidate)
 {
     return(LeftCondition.IsSatisfiedBy(candidate) &&
            RightCondition.IsSatisfiedBy(candidate));
 }