moved Game.PathFinder into World

This commit is contained in:
Bob
2010-01-18 02:04:31 +13:00
parent 2f568ce829
commit a98296c4c4
6 changed files with 14 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ namespace OpenRa.Traits.Activities
foreach( var r in refineries )
search.AddInitialCell( r.Location + refineryDeliverOffset );
var path = Game.PathFinder.FindPath( search );
var path = Game.world.PathFinder.FindPath( search );
path.Reverse();
if( path.Count != 0 )
{

View File

@@ -63,7 +63,7 @@ namespace OpenRa.Traits.Activities
checkForBlocked = true
};
search.AddInitialCell(self.Location);
return Game.PathFinder.FindPath(search);
return Game.world.PathFinder.FindPath(search);
}));
self.QueueActivity(new Harvest());
}

View File

@@ -20,7 +20,7 @@ namespace OpenRa.Traits.Activities
public Move( int2 destination, int nearEnough )
{
this.getPath = ( self, mobile ) => Game.PathFinder.FindUnitPath(
this.getPath = ( self, mobile ) => Game.world.PathFinder.FindUnitPath(
self.Location, destination,
mobile.GetMovementType() );
this.destination = destination;
@@ -30,9 +30,9 @@ namespace OpenRa.Traits.Activities
public Move(int2 destination, Actor ignoreBuilding)
{
this.getPath = (self, mobile) =>
Game.PathFinder.FindPath(
Game.world.PathFinder.FindPath(
PathSearch.FromPoint( self.Location, destination, mobile.GetMovementType(), false )
.WithCustomBlocker( Game.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
.WithCustomBlocker( Game.world.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
this.destination = destination;
this.nearEnough = 0;
@@ -41,7 +41,7 @@ namespace OpenRa.Traits.Activities
public Move( Actor target, int range )
{
this.getPath = ( self, mobile ) => Game.PathFinder.FindUnitPathToRange(
this.getPath = ( self, mobile ) => Game.world.PathFinder.FindUnitPathToRange(
self.Location, target.Location,
mobile.GetMovementType(), range );
this.destination = null;