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); }