Files
Paradise/code/__HELPERS/bitflag_lists.html

9 lines
2.1 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/__HELPERS/bitflag_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/bitflag_lists.html#define">Define Details</a></header><main><h1>code/__HELPERS/bitflag_lists.dm <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/bitflag_lists.dm"><img src="git.png" width="16" height="16" title="code/__HELPERS/bitflag_lists.dm"></a></h1><table class="summary" cellspacing="0"><tr><th><a href="code/__HELPERS/bitflag_lists.html#define/SET_BITFLAG_LIST">SET_BITFLAG_LIST</a></th><td>System for storing bitflags past the 24 limit, making use of an associative list.</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/SET_BITFLAG_LIST"><aside class="declaration">#define </aside>SET_BITFLAG_LIST<aside>(target)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/bitflag_lists.dm#L14"><img src="git.png" width="16" height="16" title="code/__HELPERS/bitflag_lists.dm 14"></a></h3><p>System for storing bitflags past the 24 limit, making use of an associative list.</p>
<p>Macro converts a list of integers into an associative list of bitflag entries for quicker comparison.
Example: list(0, 4, 26, 32)) =&gt; list(&quot;0&quot; = ( (1&lt;&lt;0) | (1&lt;&lt;4) ), &quot;1&quot; = ( (1&lt;&lt;2) | (1&lt;&lt;8) ))
Lists are cached into a global list of lists to avoid identical duplicates.
This system makes value comparisons faster than pairing every element of one list with every element of the other for evaluation.</p>
<p>Arguments:</p>
<ul>
<li>target - List of integers.</li>
</ul></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>