public override bool Equals(object obj) { var otherState = obj as NodeState; if (IsBoatOnLeftSide != otherState.IsBoatOnLeftSide) { return(false); } if (!PeopleOnLeftSide.All(c => otherState.PeopleOnLeftSide.Contains(c))) { return(false); } if (!PeopleOnRightSide.All(c => otherState.PeopleOnRightSide.Contains(c))) { return(false); } return(true); }
public int AStarSearch() { return(PeopleOnRightSide.Count(Char.IsUpper) + PeopleOnRightSide.Count); }