예제 #1
0
        private Path TryOptimizePath(Path p, IHex s, IHex g, IPathable navigator)
        {
            var extendedSet = ListUtil <IHex> .ShallowClone(p.GetTiles());

            foreach (var tile in p.GetTiles())
            {
                foreach (var neighbor in tile.GetAdjacent())
                {
                    if (!extendedSet.Contains(neighbor))
                    {
                        extendedSet.Add(neighbor);
                    }
                }
            }
            return(this.GetBruteForcePathViaFiniteSet(extendedSet, s, g, navigator));
        }