示例#1
0
 public State TryAdd(HashSet<Int32> positions)
 {
     var found = States.FirstOrDefault(st =>
         st.Values.Intersect(positions).Count() == st.Values.Union(positions).Count());
     if (found == null)
     {
         found = new State(this) { Values = positions };
         found.CurPositions = new List<RegExpTreeItem>();
         found.Values.ToList().ForEach(v => found.CurPositions.Add(AllPositions[v]));
         if (States.Count == 0) First = found;
         States.Add(found);
     }
     return found;
 }
示例#2
0
 public State MoveForward(State state, Char c)
 {
     if (!state.Moves.ContainsKey(c)) return null;
     return state.Moves[c];
 }
示例#3
0
 void Restart()
 {
     state = new Logic.State();
     updator.Start(state);
 }