IRenderable[] TemplateRenderables(WorldRenderer wr, PaletteReference palette, ushort template) { var offset = buildingInfo.CenterOffset(self.World).Y + 1024; return(footprint.Select(c => (IRenderable)(new SpriteRenderable( wr.Theater.TileSprite(new TerrainTile(template, c.Value)), wr.World.Map.CenterOfCell(c.Key), WVec.Zero, -offset, palette, 1f, true))).ToArray()); }
public Building(ActorInitializer init, BuildingInfo info) { self = init.Self; topLeft = init.Get <LocationInit, CPos>(); Info = info; occupiedCells = Info.UnpathableTiles(TopLeft) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); targetableCells = Info.FootprintTiles(TopLeft, FootprintCellType.Occupied) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); CenterPosition = init.World.Map.CenterOfCell(topLeft) + Info.CenterOffset(init.World); SkipMakeAnimation = init.Contains <SkipMakeAnimsInit>(); }
public Building(ActorInitializer init, BuildingInfo info) { self = init.Self; topLeft = init.GetValue <LocationInit, CPos>(); Info = info; influence = self.World.WorldActor.Trait <BuildingInfluence>(); occupiedCells = Info.OccupiedTiles(TopLeft) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); targetableCells = Info.FootprintTiles(TopLeft, FootprintCellType.Occupied) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); transitOnlyCells = Info.TransitOnlyTiles(TopLeft).ToArray(); CenterPosition = init.World.Map.CenterOfCell(topLeft) + Info.CenterOffset(init.World); }