Refactor footprint cell lookups and move them to Building

Removing FootprintUtils happens in the next commit for better
reviewability.
This commit is contained in:
reaperrr
2017-06-28 14:00:50 +02:00
committed by abcdefg30
parent 801796b184
commit 46dc827d46
7 changed files with 112 additions and 85 deletions

View File

@@ -227,7 +227,7 @@ namespace OpenRA.Mods.Common.Orders
var res = world.WorldActor.Trait<ResourceLayer>();
var isCloseEnough = buildingInfo.IsCloseEnoughToBase(world, world.LocalPlayer, building, topLeft);
foreach (var t in FootprintUtils.Tiles(rules, building, buildingInfo, topLeft))
foreach (var t in buildingInfo.Tiles(topLeft))
cells.Add(t, MakeCellType(isCloseEnough && world.IsCellBuildable(t, buildingInfo) && res.GetResource(t) == null));
}
@@ -248,7 +248,7 @@ namespace OpenRA.Mods.Common.Orders
IEnumerable<Order> ClearBlockersOrders(World world, CPos topLeft)
{
var allTiles = FootprintUtils.Tiles(world.Map.Rules, building, buildingInfo, topLeft).ToArray();
var allTiles = buildingInfo.Tiles(topLeft).ToArray();
var neightborTiles = Util.ExpandFootprint(allTiles, true).Except(allTiles)
.Where(world.Map.Contains).ToList();