Renormalize line endings and fix copyright headers again.
This commit is contained in:
@@ -87,12 +87,12 @@ namespace OpenRA.Mods.RA.Move
|
||||
{
|
||||
using (new PerfSample("Pathfinder"))
|
||||
{
|
||||
using(search)
|
||||
while (!search.queue.Empty)
|
||||
{
|
||||
var p = search.Expand(world);
|
||||
if (search.heuristic(p) == 0)
|
||||
return MakePath(search.cellInfo, p);
|
||||
using(search)
|
||||
while (!search.queue.Empty)
|
||||
{
|
||||
var p = search.Expand(world);
|
||||
if (search.heuristic(p) == 0)
|
||||
return MakePath(search.cellInfo, p);
|
||||
}
|
||||
|
||||
// no path exists
|
||||
@@ -114,35 +114,35 @@ namespace OpenRA.Mods.RA.Move
|
||||
ret.Add(pathNode);
|
||||
CheckSanePath(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<int2> FindBidiPath( /* searches from both ends toward each other */
|
||||
PathSearch fromSrc,
|
||||
PathSearch fromDest)
|
||||
{
|
||||
using (new PerfSample("Pathfinder"))
|
||||
{
|
||||
using (fromSrc)
|
||||
using (fromDest)
|
||||
while (!fromSrc.queue.Empty && !fromDest.queue.Empty)
|
||||
{
|
||||
/* make some progress on the first search */
|
||||
var p = fromSrc.Expand(world);
|
||||
|
||||
if (fromDest.cellInfo[p.X, p.Y].Seen && fromDest.cellInfo[p.X, p.Y].MinCost < float.PositiveInfinity)
|
||||
return MakeBidiPath(fromSrc, fromDest, p);
|
||||
|
||||
/* make some progress on the second search */
|
||||
var q = fromDest.Expand(world);
|
||||
|
||||
if (fromSrc.cellInfo[q.X, q.Y].Seen && fromSrc.cellInfo[q.X, q.Y].MinCost < float.PositiveInfinity)
|
||||
return MakeBidiPath(fromSrc, fromDest, q);
|
||||
}
|
||||
|
||||
return new List<int2>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<int2> FindBidiPath( /* searches from both ends toward each other */
|
||||
PathSearch fromSrc,
|
||||
PathSearch fromDest)
|
||||
{
|
||||
using (new PerfSample("Pathfinder"))
|
||||
{
|
||||
using (fromSrc)
|
||||
using (fromDest)
|
||||
while (!fromSrc.queue.Empty && !fromDest.queue.Empty)
|
||||
{
|
||||
/* make some progress on the first search */
|
||||
var p = fromSrc.Expand(world);
|
||||
|
||||
if (fromDest.cellInfo[p.X, p.Y].Seen && fromDest.cellInfo[p.X, p.Y].MinCost < float.PositiveInfinity)
|
||||
return MakeBidiPath(fromSrc, fromDest, p);
|
||||
|
||||
/* make some progress on the second search */
|
||||
var q = fromDest.Expand(world);
|
||||
|
||||
if (fromSrc.cellInfo[q.X, q.Y].Seen && fromSrc.cellInfo[q.X, q.Y].MinCost < float.PositiveInfinity)
|
||||
return MakeBidiPath(fromSrc, fromDest, q);
|
||||
}
|
||||
|
||||
return new List<int2>();
|
||||
}
|
||||
}
|
||||
|
||||
static List<int2> MakeBidiPath(PathSearch a, PathSearch b, int2 p)
|
||||
|
||||
Reference in New Issue
Block a user