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; }
public State MoveForward(State state, Char c) { if (!state.Moves.ContainsKey(c)) return null; return state.Moves[c]; }
void Restart() { state = new Logic.State(); updator.Start(state); }