private static void Mark(ComparisonStatus comparisonStatus, object other) { var markable = other as Markable; if (markable == null) return; markable.ComparisonStatus.CopyFrom(comparisonStatus); }
private void RecordUnknowns(ComparisonStatus other) { if (other.state.Equals(Tristate.DontKnow)) childStatuses.Add(other); }
public void CopyFrom(ComparisonStatus comparisonStatus) { state = comparisonStatus.state; if(childStatuses == null) throw new Exception("we are screwed"); childStatuses.AddRange(comparisonStatus.childStatuses); }
internal void And(ComparisonStatus other) { if (Tristate.Eager.Equals(State)) return; if(Tristate.DontKnow.Equals(other.State)) return; if (state.Equals(Tristate.DontKnow)) State = other.State; else if (state.Equals(Tristate.Lazy) && other.State.Equals(Tristate.Lazy)) State = Tristate.Lazy; else if (!other.state.Equals(Tristate.DontKnow)) State = Tristate.Eager; }
public ComparisonStatus Combine(ComparisonStatus other) { And(other); RecordUnknowns(other); return this; }