public override bool Equals(object obj) { var equivalentState = obj as EquivalentState; if (equivalentState == null) { return(false); } return(ElevatorFloor == equivalentState.ElevatorFloor && PairStates .Select((p, i) => equivalentState.PairStates[i].Equals(p)).All(b => b == true)); }
public override string ToString() { return(string.Format("{0}::{1}", ElevatorFloor, string.Join(",", PairStates.Select(ps => ps.ToString())))); }