示例#1
0
        private Guid FindUnlikeliestPath(IKrossPoint point)
        {
            if (point.IsEndPoint)
            {
                return(point.Id);
            }

            return(FindUnlikeliestPath(point.OpenPath == Direction.Left ? point.RightPath : point.LeftPath));
        }
示例#2
0
        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);
        }