Remove a bunch of unnecessary caching

This commit is contained in:
Paul Chote
2010-06-23 20:42:45 +12:00
parent b42589b479
commit 3e664779ef
5 changed files with 22 additions and 26 deletions

View File

@@ -49,6 +49,8 @@ namespace OpenRA
world = self.World;
cellInfo = InitCellInfo();
queue = new PriorityQueue<PathDistance>();
umt = self.traits.Get<Mobile>().GetMovementType();
buildingInfluence = world.WorldActor.traits.Get<BuildingInfluence>();
unitInfluence = world.WorldActor.traits.Get<UnitInfluence>();
@@ -172,31 +174,28 @@ namespace OpenRA
queue.Add( new PathDistance( heuristic( location ), location ) );
}
public static PathSearch Search( Actor self, UnitMovementType umt, bool checkForBlocked )
public static PathSearch Search( Actor self, bool checkForBlocked )
{
var search = new PathSearch(self) {
umt = umt,
checkForBlocked = checkForBlocked };
return search;
}
public static PathSearch FromPoint( Actor self, int2 from, int2 target, UnitMovementType umt, bool checkForBlocked )
public static PathSearch FromPoint( Actor self, int2 from, int2 target, bool checkForBlocked )
{
var search = new PathSearch(self) {
heuristic = DefaultEstimator( target ),
umt = umt,
checkForBlocked = checkForBlocked };
search.AddInitialCell( self.World, from );
return search;
}
public static PathSearch FromPoints(Actor self, IEnumerable<int2> froms, int2 target, UnitMovementType umt, bool checkForBlocked)
public static PathSearch FromPoints(Actor self, IEnumerable<int2> froms, int2 target, bool checkForBlocked)
{
var search = new PathSearch(self)
{
heuristic = DefaultEstimator(target),
umt = umt,
checkForBlocked = checkForBlocked
};