public State(List<Password> passwords, State prevSibling) { _observedPasswords = passwords; _currentPassword = passwords[0]; _children = new List<State>(); //GuaranteedUpperIndex = GuaranteedLowerIndex = GuaranteedNumericIndex = GuaranteedSpecialIndex = -1; Initialize(prevSibling); }
public State(State parent, State prevSibling) { if (parent != null) { _parent = parent; _observedPasswords = parent.ObservedPasswords; _observedPasswordIndex = parent.ObservedPasswordIndex + 1; _currentPassword = ObservedPasswords[ObservedPasswordIndex]; } else { _observedPasswords = prevSibling.ObservedPasswords; _currentPassword = ObservedPasswords[0]; } _children = new List<State>(); Initialize(prevSibling); }