Exemple #1
0
        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);
        }
Exemple #2
0
 public int AStarSearch()
 {
     return(PeopleOnRightSide.Count(Char.IsUpper) + PeopleOnRightSide.Count);
 }