set all data for a watchlist race in one go if race is not already on watchlist it will be added params: (id, fk, mk, fa, ma, watched)
| 827 | // if race is not already on watchlist it will be added |
| 828 | // params: (id, fk, mk, fa, ma, watched) |
| 829 | static void autobutcher_setWatchListRace(color_ostream &out, unsigned id, unsigned fk, unsigned mk, unsigned fa, unsigned ma, bool watched) { |
| 830 | if (watched_races.count(id)) { |
| 831 | DEBUG(control,out).print("updating watchlist entry\n"); |
| 832 | WatchedRace * w = watched_races[id]; |
| 833 | w->fk = fk; |
| 834 | w->mk = mk; |
| 835 | w->fa = fa; |
| 836 | w->ma = ma; |
| 837 | w->isWatched = watched; |
| 838 | w->UpdateConfig(out); |
| 839 | return; |
| 840 | } |
| 841 | |
| 842 | DEBUG(control,out).print("creating new watchlist entry\n"); |
| 843 | WatchedRace * w = new WatchedRace(out, id, watched, fk, mk, fa, ma); |
| 844 | w->UpdateConfig(out); |
| 845 | watched_races.emplace(id, w); |
| 846 | INFO(control,out).print("New race added to autobutcher watchlist: {}\n", |
| 847 | Units::getRaceNamePluralById(id).c_str()); |
| 848 | } |
| 849 | |
| 850 | // remove entry from watchlist |
| 851 | static void autobutcher_removeFromWatchList(color_ostream &out, unsigned id) { |
nothing calls this directly
no test coverage detected