Files
Paradise/datum/path_map.html

24 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/path_map - 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/path_map.html#var">Var Details</a> - <a href="datum/path_map.html#proc">Proc Details</a></header><main><h1>path_map <aside>/<a href="datum.html">datum</a>/<a href="datum/path_map.html">path_map</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L3"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 3"></a></h1><p>Datum that describes the shortest path between a source turf and any turfs within a distance</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/path_map.html#var/avoid">avoid</a></th><td>Were we avoiding a turf? If so, which one?</td></tr><tr><th><a href="datum/path_map.html#var/building">building</a></th><td>Are we currently being built</td></tr><tr><th><a href="datum/path_map.html#var/creation_time">creation_time</a></th><td>The tick we were completed on, in case you want to hold onto this for a bit</td></tr><tr><th><a href="datum/path_map.html#var/distances">distances</a></th><td>List of distances from the starting turf, each index lines up with the next_closest list</td></tr><tr><th><a href="datum/path_map.html#var/expanding">expanding</a></th><td>Are we currently being expanded?</td></tr><tr><th><a href="datum/path_map.html#var/next_closest">next_closest</a></th><td>Assoc list of turf -&gt; the turf one step closer on the path
Arranged in discovery order, so the last turf here will be the furthest from the start</td></tr><tr><th><a href="datum/path_map.html#var/pass_info">pass_info</a></th><td>The pass info datum used to create us</td></tr><tr><th><a href="datum/path_map.html#var/pass_space">pass_space</a></th><td>Were we allowed to path over space?</td></tr><tr><th><a href="datum/path_map.html#var/start">start</a></th><td>Our starting turf, the location this map feeds into</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/path_map.html#proc/compare_against">compare_against</a></th><td>Returns true if the passed in pass_map's pass logic matches ours
False otherwise</td></tr><tr><th><a href="datum/path_map.html#proc/compare_against_args">compare_against_args</a></th><td>Returns true if the passed in pass_info and start/pass_space/avoid match ours
False otherwise</td></tr><tr><th><a href="datum/path_map.html#proc/copy_from">copy_from</a></th><td>Copies the passed in path_map into this datum
Saves some headache with updating refs if we want to modify a path_map</td></tr><tr><th><a href="datum/path_map.html#proc/expand">expand</a></th><td>Expands this pathmap to cover a new range, assuming the arg is greater then the current range
Returns true if this succeeded or was not required, false otherwise</td></tr><tr><th><a href="datum/path_map.html#proc/generate_path">generate_path</a></th><td>Takes a turf to use as the other end, returns the path between the source node and it</td></tr><tr><th><a href="datum/path_map.html#proc/get_path_from">get_path_from</a></th><td>Takes a turf to start from, returns a path to the source turf of this datum</td></tr><tr><th><a href="datum/path_map.html#proc/get_path_to">get_path_to</a></th><td>Takes a turf to path to, returns the shortest path to it at the time of this datum's creation</td></tr><tr><th><a href="datum/path_map.html#proc/settings_to_path">settings_to_path</a></th><td>Returns a new /datum/pathfind/sssp based off our settings
Will have an invalid source mob, no max distance, and no ending callback</td></tr><tr><th><a href="datum/path_map.html#proc/turfs_in_range">turfs_in_range</a></th><td>Gets a list of turfs reachable by this path_map from the distance first to the distance second, both inclusive
first &gt; second or first &lt; second are both respected, and the return order will reflect the arg order
We return a list of turf -&gt; distance, or null if we error</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/avoid"><aside class="declaration">var </aside>avoid <aside> /<a href="turf.html">turf</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L18"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 18"></a></h3><p>Were we avoiding a turf? If so, which one?</p><h3 id="var/building"><aside class="declaration">var </aside>building <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L22"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 22"></a></h3><p>Are we currently being built</p><h3 id="var/creation_time"><aside class="declaration">var </aside>creation_time <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L12"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 12"></a></h3><p>The tick we were completed on, in case you want to hold onto this for a bit</p><h3 id="var/distances"><aside class="declaration">var </aside>distances <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L8"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 8"></a></h3><p>List of distances from the starting turf, each index lines up with the next_closest list</p><h3 id="var/expanding"><aside class="declaration">var </aside>expanding <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L20"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 20"></a></h3><p>Are we currently being expanded?</p><h3 id="var/next_closest"><aside class="declaration">var </aside>next_closest <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L6"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 6"></a></h3><p>Assoc list of turf -&gt; the turf one step closer on the path
Arranged in discovery order, so the last turf here will be the furthest from the start</p><h3 id="var/pass_info"><aside class="declaration">var </aside>pass_info <aside> /<a href="datum.html">datum</a>/<a href="datum/can_pass_info.html">can_pass_info</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L14"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 14"></a></h3><p>The pass info datum used to create us</p><h3 id="var/pass_space"><aside class="declaration">var </aside>pass_space <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L16"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 16"></a></h3><p>Were we allowed to path over space?</p><h3 id="var/start"><aside class="declaration">var </aside>start <aside> /<a href="turf.html">turf</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L10"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 10"></a></h3><p>Our starting turf, the location this map feeds into</p><h2 id="proc">Proc Details</h2><h3 id="proc/compare_against"><aside class="declaration">proc </aside>compare_against<aside>(/<a href="datum.html">datum</a>/<a href="datum/path_map.html">path_map</a>/map) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L114"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 114"></a></aside></h3><p>Returns true if the passed in pass_map's pass logic matches ours
False otherwise</p><h3 id="proc/compare_against_args"><aside class="declaration">proc </aside>compare_against_args<aside>(/<a href="datum.html">datum</a>/<a href="datum/can_pass_info.html">can_pass_info</a>/pass_info, /<a href="turf.html">turf</a>/start, pass_space, /<a href="turf.html">turf</a>/avoid) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L119"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 119"></a></aside></h3><p>Returns true if the passed in pass_info and start/pass_space/avoid match ours
False otherwise</p><h3 id="proc/copy_from"><aside class="declaration">proc </aside>copy_from<aside>(/<a href="datum.html">datum</a>/<a href="datum/path_map.html">path_map</a>/read_from) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L103"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 103"></a></aside></h3><p>Copies the passed in path_map into this datum
Saves some headache with updating refs if we want to modify a path_map</p><h3 id="proc/expand"><aside class="declaration">proc </aside>expand<aside>(new_range) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L141"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 141"></a></aside></h3><p>Expands this pathmap to cover a new range, assuming the arg is greater then the current range
Returns true if this succeeded or was not required, false otherwise</p><h3 id="proc/generate_path"><aside class="declaration">proc </aside>generate_path<aside>(/<a href="turf.html">turf</a>/other_end, skip_first, min_target_dist, reverse) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L75"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 75"></a></aside></h3><p>Takes a turf to use as the other end, returns the path between the source node and it</p>
<p>skip_first - If we should drop the first step in the path. Used to avoid stepping where we already are
min_target_dist - How many, if any, turfs off the end of the path should we drop?
reverse - If true, &quot;reverses&quot; the path generated. You'd want to use this for generating a path to the source node itself</p><h3 id="proc/get_path_from"><aside class="declaration">proc </aside>get_path_from<aside>(/<a href="turf.html">turf</a>/path_from, skip_first, min_target_dist) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L65"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 65"></a></aside></h3><p>Takes a turf to start from, returns a path to the source turf of this datum</p>
<p>skip_first - If we should drop the first step in the path. Used to avoid stepping where we already are
min_target_dist - How many, if any, turfs off the end of the path should we drop?</p><h3 id="proc/get_path_to"><aside class="declaration">proc </aside>get_path_to<aside>(/<a href="turf.html">turf</a>/path_to, skip_first, min_target_dist) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L56"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 56"></a></aside></h3><p>Takes a turf to path to, returns the shortest path to it at the time of this datum's creation</p>
<p>skip_first - If we should drop the first step in the path. Used to avoid stepping where we already are
min_target_dist - How many, if any, turfs off the end of the path should we drop?</p><h3 id="proc/settings_to_path"><aside class="declaration">proc </aside>settings_to_path<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L132"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 132"></a></aside></h3><p>Returns a new /datum/pathfind/sssp based off our settings
Will have an invalid source mob, no max distance, and no ending callback</p><h3 id="proc/turfs_in_range"><aside class="declaration">proc </aside>turfs_in_range<aside>(first, second) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__HELPERS/paths/sssp.dm#L27"><img src="git.png" width="16" height="16" title="code/__HELPERS/paths/sssp.dm 27"></a></aside></h3><p>Gets a list of turfs reachable by this path_map from the distance first to the distance second, both inclusive
first &gt; second or first &lt; second are both respected, and the return order will reflect the arg order
We return a list of turf -&gt; distance, or null if we error</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>