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

Function linear_index

library/include/DataDefs.h:515–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513
514template<class T>
515int linear_index(const DFHack::enum_list_attr<T> &lst, T val) {
516 for (size_t i = 0; i < lst.size; i++)
517 if (lst.items[i] == val)
518 return i;
519 return -1;
520}
521
522inline int linear_index(const DFHack::enum_list_attr<const char*> &lst, const std::string &val) {
523 for (size_t i = 0; i < lst.size; i++)

Callers 15

detach_connectionMethod · 0.50
update_ucr_alertFunction · 0.50
makeAnnouncementMethod · 0.50
autoDFAnnouncementMethod · 0.50
matchesMethod · 0.50
setJobCooldownMethod · 0.50
removeWorkerMethod · 0.50
setOwnerMethod · 0.50

Calls

no outgoing calls

Tested by 1

get_detailsFunction · 0.40