fix some extraneous refs to Game.world

This commit is contained in:
Bob
2010-04-13 20:25:16 +12:00
parent 2a4460213c
commit e38d978849
9 changed files with 42 additions and 41 deletions

View File

@@ -29,6 +29,7 @@ namespace OpenRA
{
public class PathSearch
{
World world;
public CellInfo[ , ] cellInfo;
public PriorityQueue<PathDistance> queue;
public Func<int2, float> heuristic;
@@ -42,6 +43,7 @@ namespace OpenRA
public PathSearch(World world)
{
this.world = world;
cellInfo = InitCellInfo();
queue = new PriorityQueue<PathDistance>();
@@ -171,11 +173,11 @@ namespace OpenRA
return search;
}
static CellInfo[ , ] InitCellInfo()
CellInfo[ , ] InitCellInfo()
{
var cellInfo = new CellInfo[ Game.world.Map.MapSize.X, Game.world.Map.MapSize.Y ];
for( int x = 0 ; x < Game.world.Map.MapSize.X ; x++ )
for( int y = 0 ; y < Game.world.Map.MapSize.Y ; y++ )
var cellInfo = new CellInfo[ world.Map.MapSize.X, world.Map.MapSize.Y ];
for( int x = 0 ; x < world.Map.MapSize.X ; x++ )
for( int y = 0 ; y < world.Map.MapSize.Y ; y++ )
cellInfo[ x, y ] = new CellInfo( float.PositiveInfinity, new int2( x, y ), false );
return cellInfo;
}