private Guid FindUnlikeliestPath(IKrossPoint point) { if (point.IsEndPoint) { return(point.Id); } return(FindUnlikeliestPath(point.OpenPath == Direction.Left ? point.RightPath : point.LeftPath)); }
private Guid FindEmptyEndpoint(IKrossPoint point) { if (point.IsEndPoint) { return(point.HasBall ? Guid.Empty : point.Id); } var leftPathId = FindEmptyEndpoint(point.LeftPath); var rightPathId = FindEmptyEndpoint(point.RightPath); if (leftPathId != Guid.Empty) { return(leftPathId); } if (rightPathId != Guid.Empty) { return(rightPathId); } return(Guid.Empty); }