void MarkerList::setMarker (const String& name, const RelativeCoordinate& position) { if (Marker* const m = getMarkerByName (name)) { if (m->position != position) { m->position = position; markersHaveChanged(); } return; } markers.add (new Marker (name, position)); markersHaveChanged(); }
void MarkerList::removeMarker (const int index) { if (isPositiveAndBelow (index, markers.size())) { markers.remove (index); markersHaveChanged(); } }
MarkerList& MarkerList::operator= (const MarkerList& other) { if (other != *this) { markers.clear(); markers.addCopiesOf (other.markers); markersHaveChanged(); } return *this; }
void MarkerList::removeMarker (const String& name) { for (int i = 0; i < markers.size(); ++i) { const Marker* const m = markers.getUnchecked(i); if (m->name == name) { markers.remove (i); markersHaveChanged(); } } }