Example #1
0
        private string GetSubstringByCond(char peek, ConditionFunc Condition)//Condition is a regex pattern string
        {
            StringBuilder str = new StringBuilder();

            str.Append(peek);
            while (MoveNext())
            {
                if (Condition(chars.Current))
                {
                    str.Append(chars.Current);
                }
                else
                {
                    dont_move = true;
                    return(str.ToString());
                }
            }
            dont_move = false;
            return(str.ToString());
        }
Example #2
0
 public WaitForCondition(ConditionFunc conditionFunc)
 {
     mConditionFunc = conditionFunc;
 }
 public Wait(ConditionFunc untilFunc)
 {
     Debug.Assert(untilFunc != null);
     this.untilFunc = untilFunc;
 }
Example #4
0
 public Condition(ConditionFunc conditionFunc)
 {
     this.conditionFunc = conditionFunc;
 }
Example #5
0
 public virtual bool Evaluate(Dictionary <int, int> State)
 {
     return(ConditionFunc.Invoke(State));
 }
Example #6
0
 private static bool checkAdjacents(
     int tileNumber, ConditionFunc condition)
 {
     return(findAdjacents(tileNumber).Any(adjacent => condition(adjacent)));
 }