Files
Bubberstation/code/__HELPERS/string_assoc_lists.dm
SkyratBot c487c73f39 [MIRROR] Grep for space indentation (#1969)
* Grep for space indentation

* aa

* Update species.dm

* Update species.dm

* Update maps.dm

* Update examine.dm

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-12-01 12:26:41 +01:00

18 lines
458 B
Plaintext

GLOBAL_LIST_EMPTY(string_assoc_lists)
/**
* Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
*/
/datum/proc/string_assoc_list(list/values)
var/list/string_id = list()
for(var/val in values)
string_id += "[val]_[values[val]]"
string_id = string_id.Join("-")
. = GLOB.string_assoc_lists[string_id]
if(.)
return
return GLOB.string_assoc_lists[string_id] = values