Remove FootprintUtils

This commit is contained in:
reaperrr
2017-07-01 17:44:24 +02:00
committed by abcdefg30
parent 46dc827d46
commit fdb3866238
18 changed files with 35 additions and 83 deletions

View File

@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Traits
class Bridge : IRender, INotifyDamageStateChanged
{
readonly BuildingInfo building;
readonly BuildingInfo buildingInfo;
readonly Bridge[] neighbours = new Bridge[2];
readonly LegacyBridgeHut[] huts = new LegacyBridgeHut[2]; // Huts before this / first & after this / last
readonly Health health;
@@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits
this.info = info;
type = self.Info.Name;
isDangling = new Lazy<bool>(() => huts[0] == huts[1] && (neighbours[0] == null || neighbours[1] == null));
building = self.Info.TraitInfo<BuildingInfo>();
buildingInfo = self.Info.TraitInfo<BuildingInfo>();
}
public Bridge Neighbour(int direction) { return neighbours[direction]; }
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Traits
IRenderable[] TemplateRenderables(WorldRenderer wr, PaletteReference palette, ushort template)
{
var offset = FootprintUtils.CenterOffset(self.World, building).Y + 1024;
var offset = buildingInfo.CenterOffset(self.World).Y + 1024;
return footprint.Select(c => (IRenderable)(new SpriteRenderable(
wr.Theater.TileSprite(new TerrainTile(template, c.Value)),