private void RegionManagerOnObjectRemoved(object sender, ObjectEvent e) { var structure = e.GameObject as IStructure; if (structure == null) { return; } foreach (var position in tileLocator.ForeachMultitile(structure)) { DestroyRoad(position.X, position.Y, structure.City.RoadTheme); } }
private void RegionManagerOnObjectAdded(object sender, ObjectEvent e) { var structure = e.GameObject as IStructure; if (structure == null || objectTypeFactory.IsObjectType("NoRoadRequired", structure.Type)) { return; } foreach (var position in tileLocator.ForeachMultitile(structure)) { CreateRoad(position.X, position.Y, structure.City.RoadTheme); } }