Exemple #1
0
            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));
            }
Exemple #2
0
 public override string ToString()
 {
     return(string.Format("{0}::{1}", ElevatorFloor,
                          string.Join(",", PairStates.Select(ps => ps.ToString()))));
 }