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

Function vector_get

library/include/MiscUtils.h:206–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205template<typename T>
206inline T vector_get(const std::vector<T> &vec, unsigned idx, const T &defval = T())
207{
208 if (idx < vec.size())
209 return vec[idx];
210 else
211 return defval;
212}
213
214template<typename T>
215inline T vector_get_random(const std::vector<T>& vec, const T& defval = T())

Callers 15

threadFnMethod · 0.85
GetWorldInfoFunction · 0.85
addToSquadMethod · 0.85
removeFromSquadMethod · 0.85
get_building_custom_nameFunction · 0.85
update_ucr_alertFunction · 0.85
makeAnnouncementMethod · 0.85
addCombatReportMethod · 0.85
addCombatReportAutoMethod · 0.85
autoDFAnnouncementMethod · 0.85
get_priceFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 2

printVeinsFunction · 0.68
get_detailsFunction · 0.68