Ejemplo n.º 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
     });
Ejemplo n.º 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(")");
        }
Ejemplo n.º 3
0
 public override bool IsSatisfiedBy(TBusinessObject candidate)
 {
     return(LeftCondition.IsSatisfiedBy(candidate) &&
            RightCondition.IsSatisfiedBy(candidate));
 }