예제 #1
0
파일: PathFinder.cs 프로젝트: cadm87/OpenRA
        /// <summary>
        /// Expands the path search until a path is found, and returns that path.
        /// Returned path is *reversed* and given target to source.
        /// </summary>
        public List <CPos> FindPath(PathSearch search)
        {
            while (search.CanExpand)
            {
                var p = search.Expand();

                if (search.IsTarget(p))
                {
                    return(MakePath(search.Graph, p));
                }
            }

            return(NoPath);
        }