Files
Paradise/datum/move_loop.html

15 lines
13 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/move_loop - 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="datum/move_loop.html#var">Var Details</a> - <a href="datum/move_loop.html#proc">Proc Details</a></header><main><h1>move_loop <aside>/<a href="datum.html">datum</a>/<a href="datum/move_loop.html">move_loop</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L2"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 2"></a></h1><p>Template class of the movement datums, handles the timing portion of the loops</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/move_loop.html#var/controller">controller</a></th><td>The subsystem we're processing on</td></tr><tr><th><a href="datum/move_loop.html#var/delay">delay</a></th><td>Delay between each move in deci-seconds</td></tr><tr><th><a href="datum/move_loop.html#var/extra_info">extra_info</a></th><td>An extra reference we pass around
It is on occasion useful to have a reference to some datum without storing it on the moving object
Mostly comes up in high performance senarios where we care about things being singletons
This feels horrible, but constantly making components seems worse</td></tr><tr><th><a href="datum/move_loop.html#var/flags">flags</a></th><td>Bitfield of different things that affect how a loop operates, and other mechanics around it as well.</td></tr><tr><th><a href="datum/move_loop.html#var/lifetime">lifetime</a></th><td>Time till we stop processing in deci-seconds, defaults to forever</td></tr><tr><th><a href="datum/move_loop.html#var/moving">moving</a></th><td>The thing we're moving about</td></tr><tr><th><a href="datum/move_loop.html#var/owner">owner</a></th><td>The movement packet that owns us</td></tr><tr><th><a href="datum/move_loop.html#var/priority">priority</a></th><td>Defines how different move loops override each other. Higher numbers beat lower numbers</td></tr><tr><th><a href="datum/move_loop.html#var/queued_time">queued_time</a></th><td>The time we are CURRENTLY queued for processing
Do not modify this directly</td></tr><tr><th><a href="datum/move_loop.html#var/status">status</a></th><td>Status bitfield for what state the move loop is currently in</td></tr><tr><th><a href="datum/move_loop.html#var/timer">timer</a></th><td>The next time we should process
Used primarially as a hint to be reasoned about by our [controller], and as the id of our bucket</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/move_loop.html#proc/compare_loops">compare_loops</a></th><td>check if this exact moveloop datum already exists (in terms of vars) so we can avoid creating a new one to overwrite the old duplicate</td></tr><tr><th><a href="datum/move_loop.html#proc/loop_started">loop_started</a></th><td>Called when a loop is starting by a movement subsystem</td></tr><tr><th><a href="datum/move_loop.html#proc/loop_stopped">loop_stopped</a></th><td>Called when a loop is stopped, doesn't stop the loop itself</td></tr><tr><th><a href="datum/move_loop.html#proc/move">move</a></th><td>Handles the actual move, overriden by children
Returns FALSE if nothing happen, TRUE otherwise</td></tr><tr><th><a href="datum/move_loop.html#proc/pause_for">pause_for</a></th><td>Pauses the move loop for some passed in period
This functionally means shifting its timer up, and clearing it from its current bucket</td></tr><tr><th><a href="datum/move_loop.html#proc/pause_loop">pause_loop</a></th><td>Pause our loop untill restarted with resume_loop()</td></tr><tr><th><a href="datum/move_loop.html#proc/resume_loop">resume_loop</a></th><td>Resume our loop after being paused by pause_loop()</td></tr><tr><th><a href="datum/move_loop.html#proc/set_delay">set_delay</a></th><td>Exists as a helper so outside code can modify delay in a sane way</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/controller"><aside class="declaration">var </aside>controller <aside> /<a href="datum.html">datum</a>/<a href="datum/controller.html">controller</a>/<a href="datum/controller/subsystem.html">subsystem</a>/<a href="datum/controller/subsystem/movement.html">movement</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L6"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 6"></a></h3><p>The subsystem we're processing on</p><h3 id="var/delay"><aside class="declaration">var </aside>delay <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L21"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 21"></a></h3><p>Delay between each move in deci-seconds</p><h3 id="var/extra_info"><aside class="declaration">var </aside>extra_info <aside> /<a href="datum.html">datum</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L11"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 11"></a></h3><p>An extra reference we pass around
It is on occasion useful to have a reference to some datum without storing it on the moving object
Mostly comes up in high performance senarios where we care about things being singletons
This feels horrible, but constantly making components seems worse</p><h3 id="var/flags"><aside class="declaration">var </aside>flags <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L17"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 17"></a></h3><p>Bitfield of different things that affect how a loop operates, and other mechanics around it as well.</p><h3 id="var/lifetime"><aside class="declaration">var </aside>lifetime <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L19"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 19"></a></h3><p>Time till we stop processing in deci-seconds, defaults to forever</p><h3 id="var/moving"><aside class="declaration">var </aside>moving <aside> /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L13"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 13"></a></h3><p>The thing we're moving about</p><h3 id="var/owner"><aside class="declaration">var </aside>owner <aside> /<a href="datum.html">datum</a>/<a href="datum/movement_packet.html">movement_packet</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L4"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 4"></a></h3><p>The movement packet that owns us</p><h3 id="var/priority"><aside class="declaration">var </aside>priority <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L15"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 15"></a></h3><p>Defines how different move loops override each other. Higher numbers beat lower numbers</p><h3 id="var/queued_time"><aside class="declaration">var </aside>queued_time <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L27"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 27"></a></h3><p>The time we are CURRENTLY queued for processing
Do not modify this directly</p><h3 id="var/status"><aside class="declaration">var </aside>status <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L29"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 29"></a></h3><p>Status bitfield for what state the move loop is currently in</p><h3 id="var/timer"><aside class="declaration">var </aside>timer <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L24"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 24"></a></h3><p>The next time we should process
Used primarially as a hint to be reasoned about by our [controller], and as the id of our bucket</p><h2 id="proc">Proc Details</h2><h3 id="proc/compare_loops"><aside class="declaration">proc </aside>compare_loops<aside>(/<a href="datum.html">datum</a>/<a href="datum/move_loop.html">move_loop</a>/loop_type, priority, flags, extra_info, delay, timeout) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L50"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 50"></a></aside></h3><p>check if this exact moveloop datum already exists (in terms of vars) so we can avoid creating a new one to overwrite the old duplicate</p><h3 id="proc/loop_started"><aside class="declaration">proc </aside>loop_started<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L57"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 57"></a></aside></h3><p>Called when a loop is starting by a movement subsystem</p><h3 id="proc/loop_stopped"><aside class="declaration">proc </aside>loop_stopped<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L69"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 69"></a></aside></h3><p>Called when a loop is stopped, doesn't stop the loop itself</p><h3 id="proc/move"><aside class="declaration">proc </aside>move<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L145"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 145"></a></aside></h3><p>Handles the actual move, overriden by children
Returns FALSE if nothing happen, TRUE otherwise</p><h3 id="proc/pause_for"><aside class="declaration">proc </aside>pause_for<aside>(time) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L93"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 93"></a></aside></h3><p>Pauses the move loop for some passed in period
This functionally means shifting its timer up, and clearing it from its current bucket</p><h3 id="proc/pause_loop"><aside class="declaration">proc </aside>pause_loop<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L150"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 150"></a></aside></h3><p>Pause our loop untill restarted with resume_loop()</p><h3 id="proc/resume_loop"><aside class="declaration">proc </aside>resume_loop<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L159"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 159"></a></aside></h3><p>Resume our loop after being paused by pause_loop()</p><h3 id="proc/set_delay"><aside class="declaration">proc </aside>set_delay<aside>(new_delay) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/movement/movement_types.dm#L88"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/movement/movement_types.dm 88"></a></aside></h3><p>Exists as a helper so outside code can modify delay in a sane way</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>