PathFinder doesn't really need it's own ref to Rules.Map
This commit is contained in:
@@ -9,19 +9,16 @@ namespace OpenRa.Game
|
||||
class PathFinder
|
||||
{
|
||||
float[][,] passableCost = new float[4][,];
|
||||
Map map;
|
||||
|
||||
public PathFinder(Map map)
|
||||
|
||||
public PathFinder()
|
||||
{
|
||||
this.map = map;
|
||||
|
||||
for (var umt = UnitMovementType.Foot; umt <= UnitMovementType.Float; umt++)
|
||||
passableCost[(int)umt] = new float[128, 128];
|
||||
for( int x = 0 ; x < 128 ; x++ )
|
||||
for( int y = 0 ; y < 128 ; y++ )
|
||||
for (var umt = UnitMovementType.Foot; umt <= UnitMovementType.Float; umt++ )
|
||||
passableCost[(int)umt][ x, y ] = ( map.IsInMap( x, y ) )
|
||||
? (float)TerrainCosts.Cost( umt, Rules.TileSet.GetWalkability( map.MapTiles[ x, y ] ) )
|
||||
passableCost[(int)umt][ x, y ] = ( Rules.Map.IsInMap( x, y ) )
|
||||
? (float)TerrainCosts.Cost( umt, Rules.TileSet.GetWalkability( Rules.Map.MapTiles[ x, y ] ) )
|
||||
: float.PositiveInfinity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user