diff --git a/routing/cross_mwm_graph.cpp b/routing/cross_mwm_graph.cpp index 43b015152b..786b1fec4a 100644 --- a/routing/cross_mwm_graph.cpp +++ b/routing/cross_mwm_graph.cpp @@ -49,24 +49,30 @@ bool CrossMwmGraph::IsTransition(Segment const & s, bool isOutgoing) : false; } -void CrossMwmGraph::GetAllLoadedNeighbors(NumMwmId numMwmId, - vector & neighbors, - bool & allNeighborsHaveCrossMwmSection) +bool CrossMwmGraph::GetAllLoadedNeighbors(NumMwmId numMwmId, vector & neighbors) { CHECK(m_numMwmTree, ()); m2::RectD const rect = m_countryRectFn(m_numMwmIds->GetFile(numMwmId).GetName()); - allNeighborsHaveCrossMwmSection = true; - m_numMwmTree->ForEachInRect(rect, [&](NumMwmId id) { + + bool allNeighborsHaveCrossMwmSection = true; + m_numMwmTree->ForEachInRect(rect, [&](NumMwmId id) + { if (id == numMwmId) return; MwmStatus const status = GetCrossMwmStatus(id); if (status == MwmStatus::NotLoaded) return; + if (status == MwmStatus::NoSection) + { allNeighborsHaveCrossMwmSection = false; + LOG(LWARNING, ("No cross-mwm-section for", m_numMwmIds->GetFile(id))); + } neighbors.push_back(id); }); + + return allNeighborsHaveCrossMwmSection; } void CrossMwmGraph::DeserializeTransitions(vector const & mwmIds) @@ -87,8 +93,7 @@ void CrossMwmGraph::DeserializeTransitTransitions(vector const & mwmId void CrossMwmGraph::GetTwins(Segment const & s, bool isOutgoing, vector & twins) { - ASSERT(IsTransition(s, isOutgoing), - ("The segment", s, "is not a transition segment for isOutgoing ==", isOutgoing)); + ASSERT(IsTransition(s, isOutgoing), (s, isOutgoing)); // Note. There's an extremely rare case when a segment is ingoing and outgoing at the same time. // |twins| is not filled for such cases. For details please see a note in // CrossMwmGraph::GetOutgoingEdgeList(). @@ -97,13 +102,19 @@ void CrossMwmGraph::GetTwins(Segment const & s, bool isOutgoing, vector twins.clear(); + // If you got ASSERTs here, check that m_numMwmIds and m_numMwmTree are initialized with valid + // country MWMs only, without World*, minsk-pass, or any other test MWMs. + // This may happen with ill-formed routing integration tests. +#ifdef DEBUG + auto const & file = m_numMwmIds->GetFile(s.GetMwmId()); +#endif + vector neighbors; - bool allNeighborsHaveCrossMwmSection = false; - GetAllLoadedNeighbors(s.GetMwmId(), neighbors, allNeighborsHaveCrossMwmSection); + bool const allNeighborsHaveCrossMwmSection = GetAllLoadedNeighbors(s.GetMwmId(), neighbors); + ASSERT(allNeighborsHaveCrossMwmSection, (file)); + MwmStatus const currentMwmStatus = GetCrossMwmStatus(s.GetMwmId()); - CHECK_NOT_EQUAL(currentMwmStatus, MwmStatus::NotLoaded, - ("Current mwm is not loaded. Mwm:", m_numMwmIds->GetFile(s.GetMwmId()), - "currentMwmStatus:", currentMwmStatus)); + ASSERT_EQUAL(currentMwmStatus, MwmStatus::SectionExists, (file)); if (TransitGraph::IsTransitSegment(s) && TransitCrossMwmSectionExists(s.GetMwmId())) { @@ -117,9 +128,7 @@ void CrossMwmGraph::GetTwins(Segment const & s, bool isOutgoing, vector } else { - // TODO (@gmoryes) - // May be we should add ErrorCode about "NeedUpdateMaps" and return it here. - // but until we haven't it, lets do nothing. + ASSERT(false, ("All country MWMs should have cross-mwm-section", file)); return; } diff --git a/routing/cross_mwm_graph.hpp b/routing/cross_mwm_graph.hpp index 6ccc8a7532..dc0d5b76fb 100644 --- a/routing/cross_mwm_graph.hpp +++ b/routing/cross_mwm_graph.hpp @@ -115,9 +115,7 @@ private: /// \brief Fills |neighbors| with number mwm id of all loaded neighbors of |numMwmId| and /// sets |allNeighborsHaveCrossMwmSection| to true if all loaded neighbors have cross mwm section /// and to false otherwise. - void GetAllLoadedNeighbors(NumMwmId numMwmId, - std::vector & neighbors, - bool & allNeighborsHaveCrossMwmSection); + bool GetAllLoadedNeighbors(NumMwmId numMwmId, std::vector & neighbors); /// \brief Deserizlize transitions for mwm with |ids|. void DeserializeTransitions(std::vector const & mwmIds); void DeserializeTransitTransitions(std::vector const & mwmIds); diff --git a/routing/cross_mwm_index_graph.hpp b/routing/cross_mwm_index_graph.hpp index efdc84ea59..96b2a60555 100644 --- a/routing/cross_mwm_index_graph.hpp +++ b/routing/cross_mwm_index_graph.hpp @@ -136,9 +136,9 @@ public: // build the route, because we fail in astar_algorithm.hpp CHECK(invariant) sometimes. auto const & sMwmId = m_dataSource.GetMwmIdByCountryFile(m_numMwmIds->GetFile(s.GetMwmId())); CHECK(sMwmId.IsAlive(), (s)); - auto const & twinSegMwmId = - m_dataSource.GetMwmIdByCountryFile(m_numMwmIds->GetFile(twinSeg->GetMwmId())); + auto const & twinSegMwmId = m_dataSource.GetMwmIdByCountryFile(m_numMwmIds->GetFile(twinSeg->GetMwmId())); CHECK(twinSegMwmId.IsAlive(), (*twinSeg)); + if (sMwmId.GetInfo()->GetVersion() == twinSegMwmId.GetInfo()->GetVersion() || SegmentsAreEqualByGeometry(s, *twinSeg)) { @@ -263,12 +263,13 @@ private: template CrossMwmConnector const & Deserialize(NumMwmId numMwmId, Fn && fn) { - MwmSet::MwmHandle handle = m_dataSource.GetMwmHandleByCountryFile(m_numMwmIds->GetFile(numMwmId)); + auto const & file = m_numMwmIds->GetFile(numMwmId); + MwmSet::MwmHandle handle = m_dataSource.GetMwmHandleByCountryFile(file); if (!handle.IsAlive()) - MYTHROW(RoutingException, ("Mwm", m_numMwmIds->GetFile(numMwmId), "cannot be loaded.")); + MYTHROW(RoutingException, ("Mwm", file, "cannot be loaded.")); MwmValue const * value = handle.GetValue(); - CHECK(value != nullptr, ("Country file:", m_numMwmIds->GetFile(numMwmId))); + CHECK(value != nullptr, ("Country file:", file)); FilesContainerR::TReader reader(connector::GetReader(value->m_cont)); ReaderSourceFile src(reader); diff --git a/routing/road_graph.cpp b/routing/road_graph.cpp index d67e49ee2f..613ce909f2 100644 --- a/routing/road_graph.cpp +++ b/routing/road_graph.cpp @@ -15,10 +15,10 @@ #include #include -using namespace std; - namespace routing { +using namespace std; + namespace { bool OnEdge(geometry::PointWithAltitude const & p, Edge const & ab) @@ -45,32 +45,32 @@ void SplitEdge(Edge const & ab, geometry::PointWithAltitude const & p, vector::max(), ()); - ASSERT((m_featureId.IsValid() && HasRealPart()) || (!m_featureId.IsValid() && !HasRealPart()), - ()); + ASSERT_EQUAL(m_featureId.IsValid(), HasRealPart(), ()); } Edge Edge::GetReverseEdge() const @@ -156,7 +154,7 @@ IRoadGraph::RoadInfo::RoadInfo(RoadInfo && ri) {} IRoadGraph::RoadInfo::RoadInfo(bool bidirectional, double speedKMPH, - initializer_list const & points) + initializer_list const & points) : m_junctions(points), m_speedKMPH(speedKMPH), m_bidirectional(bidirectional) {} @@ -165,9 +163,8 @@ void IRoadGraph::CrossOutgoingLoader::LoadEdges(FeatureID const & featureId, PointWithAltitudeVec const & junctions, bool bidirectional) { - ForEachEdge(junctions, [&featureId, bidirectional, this]( - size_t segId, geometry::PointWithAltitude const & endJunction, - bool forward) { + ForEachEdge(junctions, [&](size_t segId, JunctionPointT const & endJunction, bool forward) + { if (forward || bidirectional || m_mode == IRoadGraph::Mode::IgnoreOnewayTag) { m_edges.push_back(Edge::MakeReal(featureId, forward, base::asserted_cast(segId), @@ -181,9 +178,8 @@ void IRoadGraph::CrossIngoingLoader::LoadEdges(FeatureID const & featureId, PointWithAltitudeVec const & junctions, bool bidirectional) { - ForEachEdge(junctions, [&featureId, bidirectional, this]( - size_t segId, geometry::PointWithAltitude const & endJunction, - bool forward) { + ForEachEdge(junctions, [&](size_t segId, JunctionPointT const & endJunction, bool forward) + { if (!forward || bidirectional || m_mode == IRoadGraph::Mode::IgnoreOnewayTag) { m_edges.push_back(Edge::MakeReal(featureId, !forward, base::asserted_cast(segId), @@ -193,35 +189,35 @@ void IRoadGraph::CrossIngoingLoader::LoadEdges(FeatureID const & featureId, } // IRoadGraph ------------------------------------------------------------------ -void IRoadGraph::GetOutgoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { GetFakeOutgoingEdges(junction, edges); GetRegularOutgoingEdges(junction, edges); } -void IRoadGraph::GetIngoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { GetFakeIngoingEdges(junction, edges); GetRegularIngoingEdges(junction, edges); } -void IRoadGraph::GetRegularOutgoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetRegularOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { CrossOutgoingLoader loader(junction, GetMode(), edges); ForEachFeatureClosestToCross(junction.GetPoint(), loader); } -void IRoadGraph::GetRegularIngoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetRegularIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { CrossIngoingLoader loader(junction, GetMode(), edges); ForEachFeatureClosestToCross(junction.GetPoint(), loader); } -void IRoadGraph::GetFakeOutgoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetFakeOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { auto const it = m_fakeOutgoingEdges.find(junction); @@ -229,7 +225,7 @@ void IRoadGraph::GetFakeOutgoingEdges(geometry::PointWithAltitude const & juncti edges.append(it->second.cbegin(), it->second.cend()); } -void IRoadGraph::GetFakeIngoingEdges(geometry::PointWithAltitude const & junction, +void IRoadGraph::GetFakeIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const { auto const it = m_fakeIngoingEdges.find(junction); @@ -243,7 +239,7 @@ void IRoadGraph::ResetFakes() m_fakeIngoingEdges.clear(); } -void IRoadGraph::AddEdge(geometry::PointWithAltitude const & j, Edge const & e, EdgeCacheT & edges) +void IRoadGraph::AddEdge(JunctionPointT const & j, Edge const & e, EdgeCacheT & edges) { auto & cont = edges[j]; ASSERT(is_sorted(cont.cbegin(), cont.cend()), ()); @@ -254,13 +250,12 @@ void IRoadGraph::AddEdge(geometry::PointWithAltitude const & j, Edge const & e, cont.insert(range.second, e); } -void IRoadGraph::AddFakeEdges(geometry::PointWithAltitude const & junction, - vector> const & vicinity) +void IRoadGraph::AddFakeEdges(JunctionPointT const & junction, vector> const & vicinity) { for (auto const & v : vicinity) { Edge const & ab = v.first; - geometry::PointWithAltitude const p = v.second; + JunctionPointT const & p = v.second; vector edges; SplitEdge(ab, p, edges); diff --git a/routing/road_graph.hpp b/routing/road_graph.hpp index e0158d18df..5be6403b2e 100644 --- a/routing/road_graph.hpp +++ b/routing/road_graph.hpp @@ -34,28 +34,28 @@ class Edge public: Edge() = default; - Edge(Edge const &) = default; - Edge & operator=(Edge const &) = default; + + using JunctionPointT = geometry::PointWithAltitude; static Edge MakeReal(FeatureID const & featureId, bool forward, uint32_t segId, - geometry::PointWithAltitude const & startJunction, - geometry::PointWithAltitude const & endJunction); + JunctionPointT const & startJunction, + JunctionPointT const & endJunction); static Edge MakeFakeWithRealPart(FeatureID const & featureId, uint32_t fakeSegmentId, bool forward, uint32_t segId, - geometry::PointWithAltitude const & startJunction, - geometry::PointWithAltitude const & endJunction); - static Edge MakeFake(geometry::PointWithAltitude const & startJunction, - geometry::PointWithAltitude const & endJunction); - static Edge MakeFake(geometry::PointWithAltitude const & startJunction, - geometry::PointWithAltitude const & endJunction, Edge const & prototype); + JunctionPointT const & startJunction, + JunctionPointT const & endJunction); + static Edge MakeFake(JunctionPointT const & startJunction, + JunctionPointT const & endJunction); + static Edge MakeFake(JunctionPointT const & startJunction, + JunctionPointT const & endJunction, Edge const & prototype); - inline FeatureID GetFeatureId() const { return m_featureId; } + inline FeatureID const & GetFeatureId() const { return m_featureId; } inline bool IsForward() const { return m_forward; } inline uint32_t GetSegId() const { return m_segId; } inline uint32_t GetFakeSegmentId() const { return m_fakeSegmentId; } - inline geometry::PointWithAltitude const & GetStartJunction() const { return m_startJunction; } - inline geometry::PointWithAltitude const & GetEndJunction() const { return m_endJunction; } + inline JunctionPointT const & GetStartJunction() const { return m_startJunction; } + inline JunctionPointT const & GetEndJunction() const { return m_endJunction; } inline m2::PointD const & GetStartPoint() const { return m_startJunction.GetPoint(); } inline m2::PointD const & GetEndPoint() const { return m_endJunction.GetPoint(); } @@ -80,8 +80,7 @@ public: private: Edge(Type type, FeatureID const & featureId, uint32_t fakeSegmentId, bool forward, uint32_t segId, - geometry::PointWithAltitude const & startJunction, - geometry::PointWithAltitude const & endJunction); + JunctionPointT const & startJunction, JunctionPointT const & endJunction); friend std::string DebugPrint(Edge const & r); @@ -97,10 +96,10 @@ private: uint32_t m_segId = 0; // Start point of the segment on the road. - geometry::PointWithAltitude m_startJunction; + JunctionPointT m_startJunction; // End point of the segment on the road. - geometry::PointWithAltitude m_endJunction; + JunctionPointT m_endJunction; // Note. If |m_forward| == true index of |m_startJunction| point at the feature |m_featureId| // is less than index |m_endJunction|. @@ -115,17 +114,19 @@ private: class RoadGraphBase { public: + using JunctionPointT = Edge::JunctionPointT; + /// Small buffered vector to store ingoing/outgoing node's edges. using EdgeListT = SmallList; /// Big container to store full path edges. using EdgeVector = std::vector; /// Finds all nearest outgoing edges, that route to the junction. - virtual void GetOutgoingEdges(geometry::PointWithAltitude const & junction, + virtual void GetOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const = 0; /// Finds all nearest ingoing edges, that route to the junction. - virtual void GetIngoingEdges(geometry::PointWithAltitude const & junction, + virtual void GetIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const = 0; /// Returns max speed in KM/H @@ -135,7 +136,7 @@ public: virtual void GetEdgeTypes(Edge const & edge, feature::TypesHolder & types) const = 0; /// @return Types for specified junction - virtual void GetJunctionTypes(geometry::PointWithAltitude const & junction, + virtual void GetJunctionTypes(JunctionPointT const & junction, feature::TypesHolder & types) const = 0; virtual void GetRouteEdges(EdgeVector & routeEdges) const; @@ -148,10 +149,10 @@ protected: class IRoadGraph : public RoadGraphBase { public: - using Vertex = geometry::PointWithAltitude; + using Vertex = JunctionPointT; using Edge = routing::Edge; using Weight = double; - using PointWithAltitudeVec = buffer_vector; + using PointWithAltitudeVec = buffer_vector; enum class Mode { @@ -166,7 +167,7 @@ public: RoadInfo(); RoadInfo(RoadInfo && ri); RoadInfo(bool bidirectional, double speedKMPH, - std::initializer_list const & points); + std::initializer_list const & points); RoadInfo(RoadInfo const &) = default; RoadInfo & operator=(RoadInfo const &) = default; @@ -191,7 +192,7 @@ public: class ICrossEdgesLoader { public: - ICrossEdgesLoader(geometry::PointWithAltitude const & cross, IRoadGraph::Mode mode, + ICrossEdgesLoader(JunctionPointT const & cross, IRoadGraph::Mode mode, EdgeListT & edges) : m_cross(cross), m_mode(mode), m_edges(edges) { @@ -235,7 +236,7 @@ public: } } - geometry::PointWithAltitude const m_cross; + JunctionPointT const m_cross; IRoadGraph::Mode const m_mode; EdgeListT & m_edges; }; @@ -243,7 +244,7 @@ public: class CrossOutgoingLoader : public ICrossEdgesLoader { public: - CrossOutgoingLoader(geometry::PointWithAltitude const & cross, IRoadGraph::Mode mode, + CrossOutgoingLoader(JunctionPointT const & cross, IRoadGraph::Mode mode, EdgeListT & edges) : ICrossEdgesLoader(cross, mode, edges) { @@ -258,7 +259,7 @@ public: class CrossIngoingLoader : public ICrossEdgesLoader { public: - CrossIngoingLoader(geometry::PointWithAltitude const & cross, IRoadGraph::Mode mode, + CrossIngoingLoader(JunctionPointT const & cross, IRoadGraph::Mode mode, EdgeListT & edges) : ICrossEdgesLoader(cross, mode, edges) { @@ -270,10 +271,10 @@ public: bool bidirectional) override; }; - void GetOutgoingEdges(geometry::PointWithAltitude const & junction, + void GetOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const override; - void GetIngoingEdges(geometry::PointWithAltitude const & junction, + void GetIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const override; /// Removes all fake turns and vertices from the graph. @@ -281,8 +282,8 @@ public: /// Adds fake edges from fake position rp to real vicinity /// positions. - void AddFakeEdges(geometry::PointWithAltitude const & junction, - std::vector> const & vicinities); + void AddFakeEdges(JunctionPointT const & junction, + std::vector> const & vicinities); void AddOutgoingFakeEdge(Edge const & e); void AddIngoingFakeEdge(Edge const & e); @@ -303,7 +304,7 @@ public: /// @return Array of pairs of Edge and projection point on the Edge. If there is no the closest edges /// then returns empty array. virtual void FindClosestEdges(m2::RectD const & /*rect*/, uint32_t /*count*/, - std::vector> & /*vicinities*/) const {}; + std::vector> & /*vicinities*/) const {}; /// \returns Vector of pairs FeatureID and corresponding RoadInfo for road features /// lying in |rect|. @@ -323,19 +324,19 @@ public: virtual void ClearState() {} /// \brief Finds all outgoing regular (non-fake) edges for junction. - void GetRegularOutgoingEdges(geometry::PointWithAltitude const & junction, + void GetRegularOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const; /// \brief Finds all ingoing regular (non-fake) edges for junction. - void GetRegularIngoingEdges(geometry::PointWithAltitude const & junction, + void GetRegularIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const; /// \brief Finds all outgoing fake edges for junction. - void GetFakeOutgoingEdges(geometry::PointWithAltitude const & junction, EdgeListT & edges) const; + void GetFakeOutgoingEdges(JunctionPointT const & junction, EdgeListT & edges) const; /// \brief Finds all ingoing fake edges for junction. - void GetFakeIngoingEdges(geometry::PointWithAltitude const & junction, EdgeListT & edges) const; + void GetFakeIngoingEdges(JunctionPointT const & junction, EdgeListT & edges) const; private: - using EdgeCacheT = std::map; - void AddEdge(geometry::PointWithAltitude const & j, Edge const & e, EdgeCacheT & edges); + using EdgeCacheT = std::map; + void AddEdge(JunctionPointT const & j, Edge const & e, EdgeCacheT & edges); template void ForEachFakeEdge(Fn && fn) @@ -364,16 +365,16 @@ std::string DebugPrint(IRoadGraph::Mode mode); IRoadGraph::RoadInfo MakeRoadInfoForTesting(bool bidirectional, double speedKMPH, std::initializer_list const & points); -inline void JunctionsToPoints(std::vector const & junctions, - std::vector & points) +template +void JunctionsToPoints(std::vector const & junctions, std::vector & points) { points.resize(junctions.size()); for (size_t i = 0; i < junctions.size(); ++i) points[i] = junctions[i].GetPoint(); } -inline void JunctionsToAltitudes(std::vector const & junctions, - geometry::Altitudes & altitudes) +template +void JunctionsToAltitudes(std::vector const & junctions, geometry::Altitudes & altitudes) { altitudes.resize(junctions.size()); for (size_t i = 0; i < junctions.size(); ++i) diff --git a/routing/routing_helpers.cpp b/routing/routing_helpers.cpp index fb538b8140..d1d78d34a8 100644 --- a/routing/routing_helpers.cpp +++ b/routing/routing_helpers.cpp @@ -163,10 +163,10 @@ Segment ConvertEdgeToSegment(NumMwmIds const & numMwmIds, Edge const & edge) return Segment(); } - NumMwmId const numMwmId = - numMwmIds.GetId(edge.GetFeatureId().m_mwmId.GetInfo()->GetLocalFile().GetCountryFile()); + auto const & fID = edge.GetFeatureId(); + NumMwmId const numMwmId = numMwmIds.GetId(fID.m_mwmId.GetInfo()->GetLocalFile().GetCountryFile()); - return Segment(numMwmId, edge.GetFeatureId().m_index, edge.GetSegId(), edge.IsForward()); + return Segment(numMwmId, fID.m_index, edge.GetSegId(), edge.IsForward()); } bool SegmentCrossesRect(m2::Segment2D const & segment, m2::RectD const & rect) diff --git a/routing/routing_integration_tests/routing_test_tools.cpp b/routing/routing_integration_tests/routing_test_tools.cpp index cb1665ade0..7de64e7dab 100644 --- a/routing/routing_integration_tests/routing_test_tools.cpp +++ b/routing/routing_integration_tests/routing_test_tools.cpp @@ -39,22 +39,18 @@ #include #include +namespace integration +{ using namespace routing; using namespace routing_test; using namespace std; -using TRouterFactory = - function(DataSource & dataSource, TCountryFileFn const & countryFileFn, - shared_ptr numMwmIds)>; - namespace { double constexpr kErrorMeters = 1.0; double constexpr kErrorSeconds = 1.0; } // namespace -namespace integration -{ shared_ptr CreateFeaturesFetcher(vector const & localFiles) { size_t const maxOpenFileNumber = 4096; @@ -118,8 +114,15 @@ unique_ptr CreateVehicleRouter(DataSource & dataSource, void GetAllLocalFiles(vector & localFiles) { - platform::FindAllLocalMapsAndCleanup(numeric_limits::max() /* latestVersion */, - localFiles); + platform::FindAllLocalMapsAndCleanup(numeric_limits::max() /* latestVersion */, localFiles); + + // Leave only real country files for routing test. + localFiles.erase(std::remove_if(localFiles.begin(), localFiles.end(), [](LocalCountryFile const & file) + { + auto const & name = file.GetCountryName(); + return name == WORLD_FILE_NAME || name == WORLD_COASTS_FILE_NAME; + }), localFiles.end()); + for (auto & file : localFiles) file.SyncWithDisk(); }