MCPcopy Create free account
hub / github.com/comaps/comaps / CanMarkPlaceAsDisused

Method CanMarkPlaceAsDisused

libs/indexer/editable_map_object.cpp:109–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109bool EditableMapObject::CanMarkPlaceAsDisused() const
110{
111 if (GetEditingLifecycle() == EditingLifecycle::CREATED)
112 return false;
113
114 auto types = GetTypes();
115 types.SortBySpec();
116 uint32_t mainType = *types.begin();
117 std::string mainTypeStr = classif().GetReadableObjectName(mainType);
118
119 constexpr string_view typePrefixes[] = {
120 "shop",
121 "amenity-restaurant",
122 "amenity-fast_food",
123 "amenity-cafe",
124 "amenity-pub",
125 "amenity-bar",
126 "amenity-ice_cream",
127 "amenity-pharmacy",
128 "amenity-post_office",
129 "amenity-bank",
130 "amenity-bureau_de_change",
131 "amenity-car_rental",
132 "amenity-motorcycle_rental",
133 "amenity-casino",
134 "amenity-gambling",
135 "amenity-internet_cafe",
136 "craft-confectionery",
137 "craft-electronics_repair",
138 "raft-shoemaker",
139 "craft-tailor",
140 "craft-key_cutter",
141 "craft-locksmith",
142 "office-estate_agent",
143 "office-insurance",
144 };
145
146 for (auto const & typePrefix : typePrefixes)
147 if (mainTypeStr.starts_with(typePrefix))
148 return true;
149
150 return false;
151}
152
153NamesDataSource EditableMapObject::GetNamesDataSource()
154{

Calls 4

GetTypesFunction · 0.85
SortBySpecMethod · 0.80
GetReadableObjectNameMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected