mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 05:57:24 +01:00
32 lines
22 KiB
HTML
32 lines
22 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/__HELPERS/lists.dm - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="code/__HELPERS/lists.html#define">Define Details</a></header><main><h1>code/__HELPERS/lists.dm <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm"></a></h1><table class="summary" cellspacing="0"><tr><th><a href="code/__HELPERS/lists.html#define/COMPARE_KEY">COMPARE_KEY</a></th><td>Passed into BINARY_INSERT to compare keys</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/COMPARE_VALUE">COMPARE_VALUE</a></th><td>Passed into BINARY_INSERT to compare values</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/BINARY_INSERT_TG">BINARY_INSERT_TG</a></th><td>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.</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/BINARY_INSERT_REVERSE">BINARY_INSERT_REVERSE</a></th><td>The above but the tree is sorted in reverse.</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/BINARY_INSERT_DEFINE">BINARY_INSERT_DEFINE</a></th><td>Even more custom binary search sorted insert, using defines instead of vars
|
|
INPUT: Item to be inserted
|
|
LIST: List to insert INPUT into
|
|
TYPECONT: A define setting the var to the typepath of the contents of the list
|
|
COMPARE: The item to compare against, usualy the same as INPUT
|
|
COMPARISON: A define that takes an item to compare as input, and returns their comparable value
|
|
COMPTYPE: How should the list be compared? Either COMPARE_KEY or COMPARE_VALUE.</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LIST_VALUE_WRAP_LISTS">LIST_VALUE_WRAP_LISTS</a></th><td>If value is a list, wrap it in a list so it can be used with list add/remove operations</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/UNTYPED_LIST_ADD">UNTYPED_LIST_ADD</a></th><td>Add an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun</td></tr><tr><th>/proc/<a href="global.html#proc/pickweight">pickweight</a></th><td>Picks an element based on its weight.
|
|
L - The input list</td></tr><tr><th>/proc/<a href="global.html#proc/pickweight_fraction">pickweight_fraction</a></th><td>Picks an element based on its weight. Weight can be any real number
|
|
L - The input list</td></tr><tr><th>/proc/<a href="global.html#proc/pick_multiple_unique">pick_multiple_unique</a></th><td>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</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYINITLIST">LAZYINITLIST</a></th><td>Initialize the lazylist</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/UNSETEMPTY">UNSETEMPTY</a></th><td>If the provided list is empty, set it to null</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/ASSOC_UNSETEMPTY">ASSOC_UNSETEMPTY</a></th><td>If the provided key -> list is empty, remove it from the list</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYLISTDUPLICATE">LAZYLISTDUPLICATE</a></th><td>Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYREMOVE">LAZYREMOVE</a></th><td>Remove an item from the list, set the list to null if empty</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYADD">LAZYADD</a></th><td>Add an item to the list, if the list is null it will initialize it</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYOR">LAZYOR</a></th><td>Add an item to the list if not already present, if the list is null it will initialize it</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYDISTINCTADD">LAZYDISTINCTADD</a></th><td>Adds I to L, initializing L if necessary, if I is not already in L</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYACCESS">LAZYACCESS</a></th><td>returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYLEN">LAZYLEN</a></th><td>Returns the length of L</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYNULL">LAZYNULL</a></th><td>Sets a list to null</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYCLEARLIST">LAZYCLEARLIST</a></th><td>Removes all elements from the list</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYCOPY">LAZYCOPY</a></th><td>Use LAZYLISTDUPLICATE instead if you want it to null with no entries</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYSET">LAZYSET</a></th><td>Sets the item K to the value V, if the list is null it will initialize it</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYSETLEN">LAZYSETLEN</a></th><td>Sets the length of a lazylist</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYADDASSOC">LAZYADDASSOC</a></th><td>Adds to the item K the value V, if the list is null it will initialize it</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYADDASSOCLIST">LAZYADDASSOCLIST</a></th><td>This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYREMOVEASSOC">LAZYREMOVEASSOC</a></th><td>Removes the value V from the item K, if the item K is empty will remove it from the list, if the list is empty will set the list to null</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYACCESSASSOC">LAZYACCESSASSOC</a></th><td>Accesses an associative list, returns null if nothing is found</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/QDEL_LAZYLIST">QDEL_LAZYLIST</a></th><td>Qdel every item in the list before setting the list to null</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYIN">LAZYIN</a></th><td>If the lazy list is currently initialized find item I in list L</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/ISINDEXSAFE">ISINDEXSAFE</a></th><td>Returns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)).</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LAZYORASSOCLIST">LAZYORASSOCLIST</a></th><td>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.</td></tr><tr><th><a href="code/__HELPERS/lists.html#define/LISTASSERTLEN">LISTASSERTLEN</a></th><td>Ensures the length of a list is at least I, prefilling it with V if needed. if V is a proc call, it is repeated for each new index so that list() can just make a new list for each item.</td></tr><tr><th>/proc/<a href="global.html#proc/make_associative">make_associative</a></th><td>A proc for turning a list into an associative list.</td></tr><tr><th>/proc/<a href="global.html#proc/compare_list">compare_list</a></th><td>compare two lists, returns TRUE if they are the same</td></tr><tr><th>/proc/<a href="global.html#proc/avoid_assoc_duplicate_keys">avoid_assoc_duplicate_keys</a></th><td>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</td></tr><tr><th>/proc/<a href="global.html#proc/assoc_to_keys">assoc_to_keys</a></th><td>Turns an associative list into a flat list of keys</td></tr><tr><th>/proc/<a href="global.html#proc/fill_with_ones">fill_with_ones</a></th><td>Given a list, return a copy where values without defined weights are given weight 1.
|
|
For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1)
|
|
Useful for weighted random choices (loot tables, syllables in languages, etc.)</td></tr><tr><th>/proc/<a href="global.html#proc/pick_weight_recursive">pick_weight_recursive</a></th><td>Like pick_weight, but allowing for nested lists.</td></tr><tr><th>/proc/<a href="global.html#proc/lists_equal_unordered">lists_equal_unordered</a></th><td>Checks to make sure that the lists have the exact same contents, ignores the order of the contents.</td></tr><tr><th>/proc/<a href="global.html#proc/list_clear_nulls">list_clear_nulls</a></th><td>Removes any null entries from the list
|
|
Returns TRUE if the list had nulls, FALSE otherwise</td></tr><tr><th>/proc/<a href="global.html#proc/flatten_list">flatten_list</a></th><td>Flattens a keyed list into a list of its contents</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/ASSOC_UNSETEMPTY"><aside class="declaration">#define </aside>ASSOC_UNSETEMPTY<aside>(L, K)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L775"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 775"></a></h3><p>If the provided key -> list is empty, remove it from the list</p><h3 id="define/BINARY_INSERT_DEFINE"><aside class="declaration">#define </aside>BINARY_INSERT_DEFINE<aside>(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L92"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 92"></a></h3><p>Even more custom binary search sorted insert, using defines instead of vars
|
|
INPUT: Item to be inserted
|
|
LIST: List to insert INPUT into
|
|
TYPECONT: A define setting the var to the typepath of the contents of the list
|
|
COMPARE: The item to compare against, usualy the same as INPUT
|
|
COMPARISON: A define that takes an item to compare as input, and returns their comparable value
|
|
COMPTYPE: How should the list be compared? Either COMPARE_KEY or COMPARE_VALUE.</p><h3 id="define/BINARY_INSERT_REVERSE"><aside class="declaration">#define </aside>BINARY_INSERT_REVERSE<aside>(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L53"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 53"></a></h3><p>The above but the tree is sorted in reverse.</p><h3 id="define/BINARY_INSERT_TG"><aside class="declaration">#define </aside>BINARY_INSERT_TG<aside>(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L26"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 26"></a></h3><p>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.</p><h3 id="define/COMPARE_KEY"><aside class="declaration">#define </aside>COMPARE_KEY <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L13"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 13"></a></h3><p>Passed into BINARY_INSERT to compare keys</p><h3 id="define/COMPARE_VALUE"><aside class="declaration">#define </aside>COMPARE_VALUE <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L15"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 15"></a></h3><p>Passed into BINARY_INSERT to compare values</p><h3 id="define/ISINDEXSAFE"><aside class="declaration">#define </aside>ISINDEXSAFE<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L815"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 815"></a></h3><p>Returns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)).</p><h3 id="define/LAZYACCESS"><aside class="declaration">#define </aside>LAZYACCESS<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L787"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 787"></a></h3><p>returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list</p><h3 id="define/LAZYACCESSASSOC"><aside class="declaration">#define </aside>LAZYACCESSASSOC<aside>(L, I, K)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L809"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 809"></a></h3><p>Accesses an associative list, returns null if nothing is found</p><h3 id="define/LAZYADD"><aside class="declaration">#define </aside>LAZYADD<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L781"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 781"></a></h3><p>Add an item to the list, if the list is null it will initialize it</p><h3 id="define/LAZYADDASSOC"><aside class="declaration">#define </aside>LAZYADDASSOC<aside>(L, K, V)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L803"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 803"></a></h3><p>Adds to the item K the value V, if the list is null it will initialize it</p><h3 id="define/LAZYADDASSOCLIST"><aside class="declaration">#define </aside>LAZYADDASSOCLIST<aside>(L, K, V)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L805"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 805"></a></h3><p>This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)</p><h3 id="define/LAZYCLEARLIST"><aside class="declaration">#define </aside>LAZYCLEARLIST<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L793"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 793"></a></h3><p>Removes all elements from the list</p><h3 id="define/LAZYCOPY"><aside class="declaration">#define </aside>LAZYCOPY<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L797"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 797"></a></h3><p>Use LAZYLISTDUPLICATE instead if you want it to null with no entries</p><h3 id="define/LAZYDISTINCTADD"><aside class="declaration">#define </aside>LAZYDISTINCTADD<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L785"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 785"></a></h3><p>Adds I to L, initializing L if necessary, if I is not already in L</p><h3 id="define/LAZYIN"><aside class="declaration">#define </aside>LAZYIN<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L813"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 813"></a></h3><p>If the lazy list is currently initialized find item I in list L</p><h3 id="define/LAZYINITLIST"><aside class="declaration">#define </aside>LAZYINITLIST<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L771"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 771"></a></h3><p>Initialize the lazylist</p><h3 id="define/LAZYLEN"><aside class="declaration">#define </aside>LAZYLEN<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L789"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 789"></a></h3><p>Returns the length of L</p><h3 id="define/LAZYLISTDUPLICATE"><aside class="declaration">#define </aside>LAZYLISTDUPLICATE<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L777"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 777"></a></h3><p>Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled</p><h3 id="define/LAZYNULL"><aside class="declaration">#define </aside>LAZYNULL<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L791"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 791"></a></h3><p>Sets a list to null</p><h3 id="define/LAZYOR"><aside class="declaration">#define </aside>LAZYOR<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L783"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 783"></a></h3><p>Add an item to the list if not already present, if the list is null it will initialize it</p><h3 id="define/LAZYORASSOCLIST"><aside class="declaration">#define </aside>LAZYORASSOCLIST<aside>(lazy_list, key, value)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L818"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 818"></a></h3><p>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.</p><h3 id="define/LAZYREMOVE"><aside class="declaration">#define </aside>LAZYREMOVE<aside>(L, I)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L779"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 779"></a></h3><p>Remove an item from the list, set the list to null if empty</p><h3 id="define/LAZYREMOVEASSOC"><aside class="declaration">#define </aside>LAZYREMOVEASSOC<aside>(L, K, V)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L807"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 807"></a></h3><p>Removes the value V from the item K, if the item K is empty will remove it from the list, if the list is empty will set the list to null</p><h3 id="define/LAZYSET"><aside class="declaration">#define </aside>LAZYSET<aside>(L, K, V)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L799"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 799"></a></h3><p>Sets the item K to the value V, if the list is null it will initialize it</p><h3 id="define/LAZYSETLEN"><aside class="declaration">#define </aside>LAZYSETLEN<aside>(L, V)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L801"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 801"></a></h3><p>Sets the length of a lazylist</p><h3 id="define/LISTASSERTLEN"><aside class="declaration">#define </aside>LISTASSERTLEN<aside>(L, I, V ...)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L824"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 824"></a></h3><p>Ensures the length of a list is at least I, prefilling it with V if needed. if V is a proc call, it is repeated for each new index so that list() can just make a new list for each item.</p><h3 id="define/LIST_VALUE_WRAP_LISTS"><aside class="declaration">#define </aside>LIST_VALUE_WRAP_LISTS<aside>(value)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L120"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 120"></a></h3><p>If value is a list, wrap it in a list so it can be used with list add/remove operations</p><h3 id="define/QDEL_LAZYLIST"><aside class="declaration">#define </aside>QDEL_LAZYLIST<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L811"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 811"></a></h3><p>Qdel every item in the list before setting the list to null</p><h3 id="define/UNSETEMPTY"><aside class="declaration">#define </aside>UNSETEMPTY<aside>(L)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L773"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 773"></a></h3><p>If the provided list is empty, set it to null</p><h3 id="define/UNTYPED_LIST_ADD"><aside class="declaration">#define </aside>UNTYPED_LIST_ADD<aside>(list, item)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/lists.dm#L122"><img src="git.png" width="16" height="16" title="code/__HELPERS/lists.dm 122"></a></h3><p>Add an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |