static void SetAirfieldDetails(Waypoints &way_points, const TCHAR *name, const tstring &Details) { const Waypoint *wp = find_waypoint(way_points, name); if (wp == NULL) return; Waypoint new_wp(*wp); new_wp.details = Details.c_str(); way_points.Replace(*wp, new_wp); way_points.Optimise(); }
static bool TestReplace(Waypoints& waypoints, unsigned id) { auto wp = waypoints.LookupId(id); if (wp == NULL) return false; tstring oldName = wp->name; Waypoint copy = *wp; copy.name = _T("Fred"); waypoints.Replace(wp, std::move(copy)); waypoints.Optimise(); wp = waypoints.LookupId(id); return wp != NULL && wp->name != oldName && wp->name == _T("Fred"); }
static void SetAirfieldDetails(Waypoints &way_points, const TCHAR *name, const tstring &Details, const std::vector<tstring> &files_external, const std::vector<tstring> &files_embed) { const Waypoint *wp = FindWaypoint(way_points, name); if (wp == NULL) return; Waypoint new_wp(*wp); new_wp.details = Details.c_str(); new_wp.files_embed.assign(files_embed.begin(), files_embed.end()); #ifdef ANDROID new_wp.files_external.assign(files_external.begin(), files_external.end()); #endif way_points.Replace(*wp, new_wp); way_points.Optimise(); }