MCPcopy Create free account
hub / github.com/DFHack/dfhack / autobutcher_setWatchListRace

Function autobutcher_setWatchListRace

plugins/autobutcher.cpp:829–848  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

827// if race is not already on watchlist it will be added
828// params: (id, fk, mk, fa, ma, watched)
829static 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
851static void autobutcher_removeFromWatchList(color_ostream &out, unsigned id) {

Callers

nothing calls this directly

Calls 4

UpdateConfigMethod · 0.80
c_strMethod · 0.80
countMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected