protected virtual void AddedToWorld(Actor self) { if (Info.RemoveSmudgesOnBuild) { RemoveSmudges(); } self.World.AddToMaps(self, this); influence.AddInfluence(self, Info.Tiles(self.Location)); }
public static bool CanPlaceBuilding(this World world, string name, BuildingInfo building, CPos topLeft, Actor toIgnore) { if (building.AllowInvalidPlacement) { return(true); } var res = world.WorldActor.TraitOrDefault <ResourceLayer>(); return(building.Tiles(topLeft).All(t => world.Map.Contains(t) && (res == null || res.GetResource(t) == null) && world.IsCellBuildable(t, building, toIgnore))); }