Use named pathfinding constants.
- Rename CostForInvalidCell to PathCostForInvalidPath - Add MovementCostForUnreachableCell - Update usages of int.MaxValue and short.Maxvalue to use named constants where relevant. - Update costs on ICustomMovementLayer to return short, for consistency with costs from Locomotor. - Rename some methods to distinguish between path/movement cost.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
{
|
||||
defaultLayer =
|
||||
CellLayer<CellInfo>.CreateInstance(
|
||||
mpos => new CellInfo(int.MaxValue, int.MaxValue, mpos.ToCPos(map), CellStatus.Unvisited),
|
||||
mpos => new CellInfo(PathGraph.PathCostForInvalidPath, PathGraph.PathCostForInvalidPath, mpos.ToCPos(map), CellStatus.Unvisited),
|
||||
new Size(map.MapSize.X, map.MapSize.Y),
|
||||
map.Grid.Type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user