Space Station 13 - Modules - TypesDefine Details

code/__HELPERS/lists.dm

COMPARE_KEYPassed into BINARY_INSERT to compare keys
COMPARE_VALUEPassed into BINARY_INSERT to compare values
BINARY_INSERT_TGBinary search sorted insert from TG INPUT: Object to be inserted LIST: List to insert object into TYPECONT: The typepath of the contents of the list COMPARE: The object to compare against, usualy the same as INPUT COMPARISON: The variable on the objects to compare COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE.
/proc/pickweight Picks an element based on its weight. L - The input list
/proc/pick_multiple_unique Picks multiple unique elements from the suplied list. If the given list has a length less than the amount given then it will return a list with an equal amount
LAZYDISTINCTADDAdds I to L, initializing L if necessary, if I is not already in L
ISINDEXSAFEReturns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)).
LAZYINIf the lazy list is currently initialized find item I in list L
LAZYORASSOCLISTPerforms an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.
/proc/make_associative A proc for turning a list into an associative list.
/proc/compare_list compare two lists, returns TRUE if they are the same
/proc/avoid_assoc_duplicate_keys takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input

Define Details

BINARY_INSERT_TG

Binary search sorted insert from TG INPUT: Object to be inserted LIST: List to insert object into TYPECONT: The typepath of the contents of the list COMPARE: The object to compare against, usualy the same as INPUT COMPARISON: The variable on the objects to compare COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE.

COMPARE_KEY

Passed into BINARY_INSERT to compare keys

COMPARE_VALUE

Passed into BINARY_INSERT to compare values

ISINDEXSAFE

Returns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)).

LAZYDISTINCTADD

Adds I to L, initializing L if necessary, if I is not already in L

LAZYIN

If the lazy list is currently initialized find item I in list L

LAZYORASSOCLIST

Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.