<spanid="evennia-contrib-grid-xyzgrid-xymap-legend"></span><h1>evennia.contrib.grid.xyzgrid.xymap_legend<aclass="headerlink"href="#module-evennia.contrib.grid.xyzgrid.xymap_legend"title="Permalink to this headline">¶</a></h1>
<sectionid="map-legend-components">
<h2>Map legend components<aclass="headerlink"href="#map-legend-components"title="Permalink to this headline">¶</a></h2>
<p>Each map-legend component is either a ‘mapnode’ - something that represents and actual in-game
location (usually a room) or a ‘maplink’ - something connecting nodes together. The start of a link
usually shows as an Exit, but the length of the link has no in-game equivalent.</p>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">interrupt_path</code><emclass="property"> = False</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.interrupt_path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">multilink</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.multilink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">node_index</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.node_index"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '#'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">log</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">msg</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.log"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.log"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">generate_prototype_key</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.generate_prototype_key"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.generate_prototype_key"title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a deterministic prototype key to allow for users to apply prototypes without
<codeclass="sig-name descname">build_links</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.build_links"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.build_links"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called by the map parser when this node is encountered. It tells the node
to scan in all directions and follow any found links to other nodes. Since there
could be multiple steps to reach another node, the system will iterate down each
path and store it once and for all.</p>
<pclass="rubric">Notes</p>
<p>This sets up all data needed for later use of this node in pathfinding and
other operations. The method can’t run immediately when the node is created
<codeclass="sig-name descname">linkweights</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">nnodes</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.linkweights"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.linkweights"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve all the weights for the direct links to all other nodes. This is
used for the efficient generation of shortest-paths.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>nnodes</strong> (<em>int</em>) – The total number of nodes</p>
<codeclass="sig-name descname">get_display_symbol</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.get_display_symbol"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.get_display_symbol"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook to override for customizing how the display_symbol is determined.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>str</em>– The display-symbol to use. This must visually be a single character
but could have color markers, use a unicode font etc.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>By default, just setting .display_symbol is enough.</p>
<codeclass="sig-name descname">get_spawn_xyz</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.get_spawn_xyz"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.get_spawn_xyz"title="Permalink to this definition">¶</a></dt>
<dd><p>This should return the XYZ-coordinates for spawning this node. This normally
the XYZ of the current map, but for traversal-nodes, it can also be the location
on another map.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>tuple</em>– The (X, Y, Z) coords to spawn this node at.</p>
<codeclass="sig-name descname">get_exit_spawn_name</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">direction</span></em>, <emclass="sig-param"><spanclass="n">return_aliases</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.get_exit_spawn_name"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.get_exit_spawn_name"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the spawn name for the exit being created by this link.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>direction</strong> (<em>str</em>) – The cardinal direction (n,ne etc) the want the
exit name/aliases for.</p></li>
<li><p><strong>return_aliases</strong> (<em>bool</em><em>, </em><em>optional</em>) – Also return all aliases.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>str or tuple</em>– The key of the spawned exit, or a tuple (key, alias, alias, …)</p>
<codeclass="sig-name descname">spawn</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.spawn"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.spawn"title="Permalink to this definition">¶</a></dt>
<dd><p>Build an actual in-game room from this node.</p>
<p>This should be called as part of the node-sync step of the map sync. The reason is
that the exits (next step) requires all nodes to exist before they can link up
<codeclass="sig-name descname">spawn_links</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">directions</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.spawn_links"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.spawn_links"title="Permalink to this definition">¶</a></dt>
<dd><p>Build actual in-game exits based on the links out of this room.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>directions</strong> (<em>list</em><em>, </em><em>optional</em>) – If given, this should be a list of supported
directions (n, ne, etc). Only links in these directions will be spawned
for this node.</p>
</dd>
</dl>
<p>This should be called after all <strong>sync_node_to_grid</strong> operations have finished across
the entire XYZgrid. This creates/syncs all exits to their locations and destinations.</p>
<codeclass="sig-name descname">unspawn</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapNode.unspawn"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapNode.unspawn"title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all spawned objects related to this node and all links.</p>
<spanclass="c1">#-T #- - one-way transition from map1 -> map2.</span>
<spanclass="c1">#-T T-# - two-way. Both TransitionMapNodes links to the coords of the</span>
<spanclass="n">actual</span><spanclass="n">rooms</span><spanclass="p">(</span><spanclass="o">**</span><spanclass="c1">#**) on the other map (NOT to the **T**s)!</span>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'T'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TransitionMapNode.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = ' '</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TransitionMapNode.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">taget_map_xyz</code><emclass="property"> = (None, None, None)</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TransitionMapNode.taget_map_xyz"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_spawn_xyz</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#TransitionMapNode.get_spawn_xyz"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TransitionMapNode.get_spawn_xyz"title="Permalink to this definition">¶</a></dt>
<dd><p>Make sure to return the coord of the <em>target</em> - this will be used when building
the exit to this node (since the prototype is None, this node itself will not be built).</p>
<codeclass="sig-name descname">build_links</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#TransitionMapNode.build_links"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TransitionMapNode.build_links"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">default_weight</code><emclass="property"> = 1</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.default_weight"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">average_long_link_weights</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.average_long_link_weights"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">direction_aliases</code><emclass="property"> = {}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.direction_aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">weights</code><emclass="property"> = {}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.weights"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">multilink</code><emclass="property"> = False</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.multilink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">interrupt_path</code><emclass="property"> = False</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.interrupt_path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">spawn_aliases</code><emclass="property"> = {}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.spawn_aliases"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">x</span></em>, <emclass="sig-param"><spanclass="n">y</span></em>, <emclass="sig-param"><spanclass="n">Z</span></em>, <emclass="sig-param"><spanclass="n">symbol</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">xymap</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.__init__"title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize the link.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>x</strong> (<em>int</em>) – The xygrid x coordinate</p></li>
<li><p><strong>y</strong> (<em>int</em>) – The xygrid y coordinate.</p></li>
<li><p><strong>X</strong> (<em>int</em><em> or </em><em>str</em>) – The name/Z-coord of this map we are on.</p></li>
<li><p><strong>symbol</strong> (<em>str</em><em>, </em><em>optional</em>) – Set during parsing, allows to override
the default symbol with the one set in the legend.</p></li>
<li><p><strong>xymap</strong> (<aclass="reference internal"href="evennia.contrib.grid.xyzgrid.xymap.html#evennia.contrib.grid.xyzgrid.xymap.XYMap"title="evennia.contrib.grid.xyzgrid.xymap.XYMap"><em>XYMap</em></a><em>, </em><em>optional</em>) – The map object this sits on.</p></li>
<codeclass="sig-name descname">symbol</code><emclass="property"> = ''</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">generate_prototype_key</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.generate_prototype_key"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.generate_prototype_key"title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a deterministic prototype key to allow for users to apply prototypes without
needing a separate new name for every one.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>*args</strong> (<em>str</em>) – These are used to further seed the key.</p>
<codeclass="sig-name descname">traverse</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em>, <emclass="sig-param"><spanclass="n">_weight</span><spanclass="o">=</span><spanclass="default_value">0</span></em>, <emclass="sig-param"><spanclass="n">_linklen</span><spanclass="o">=</span><spanclass="default_value">1</span></em>, <emclass="sig-param"><spanclass="n">_steps</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.traverse"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.traverse"title="Permalink to this definition">¶</a></dt>
<dd><p>Recursively traverse the links out of this LinkNode.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>start_direction</strong> (<em>str</em>) – The direction (n, ne etc) from which
<dt>The (node, weight, links) result of the traversal, where links</dt><dd><p>is a list of directions (n, ne etc) that describes how to to get
to the node on the grid. This includes the first direction.</p>
</dd>
</dl>
</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><aclass="reference internal"href="evennia.contrib.grid.xyzgrid.utils.html#evennia.contrib.grid.xyzgrid.utils.MapParserError"title="evennia.contrib.grid.xyzgrid.utils.MapParserError"><strong>MapParserError</strong></a>– If a link lead to nowhere.</p>
<codeclass="sig-name descname">get_linked_neighbors</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">directions</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.get_linked_neighbors"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.get_linked_neighbors"title="Permalink to this definition">¶</a></dt>
<dd><p>A helper to get all directions to which there appears to be a
visual link/node. This does not trace the length of the link and check weights etc.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>directions</strong> (<em>list</em><em>, </em><em>optional</em>) – Only scan in these directions.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>dict</em>– Mapping {direction: node_or_link} wherever such was found.</p>
<codeclass="sig-name descname">at_empty_target</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em>, <emclass="sig-param"><spanclass="n">end_direction</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.at_empty_target"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.at_empty_target"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called by <strong>.traverse</strong> when it finds this link pointing to nowhere.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>start_direction</strong> (<em>str</em>) – The direction (n, ne etc) from which
this traversal originates for this link.</p></li>
<li><p><strong>end_direction</strong> (<em>str</em>) – The direction found from <strong>get_direction</strong> earlier.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>MapNode, MapLink or None</em>– The next target to go to from here. <strong>None</strong> if this
is an error that should be reported.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>This is usually a mapping error (returning <strong>None</strong>) but may have practical use, such as
<codeclass="sig-name descname">get_direction</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.get_direction"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.get_direction"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook to override for customizing how the directions are
determined.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>start_direction</strong> (<em>str</em>) – The starting direction (n, ne etc).</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><p><em>str</em>–</p>
<dlclass="simple">
<dt>The ‘out’ direction side of the link - where the link</dt><dd><p>leads to.</p>
</dd>
</dl>
</p>
</dd>
</dl>
<pclass="rubric">Example</p>
<p>With the default legend, if the link is a straght vertical link
(<strong>|</strong>) and <strong>start_direction</strong> is <strong>s</strong> (link is approached from
from the south side), then this function will return <ahref="#id5"><spanclass="problematic"id="id6">**</span></a>n’.</p>
<codeclass="sig-name descname">get_weight</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em>, <emclass="sig-param"><spanclass="n">current_weight</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.get_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.get_weight"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook to override for customizing how the weights are determined.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>start_direction</strong> (<em>str</em>) – The starting direction (n, ne etc).</p></li>
<li><p><strong>current_weight</strong> (<em>int</em>) – This can have an existing value if
we are progressing down a multi-step path.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>int</em>– The weight to use for a link from <strong>start_direction</strong>.</p>
<codeclass="sig-name descname">get_display_symbol</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#MapLink.get_display_symbol"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapLink.get_display_symbol"title="Permalink to this definition">¶</a></dt>
<dd><p>Hook to override for customizing how the display_symbol is determined.
This is called after all other hooks, at map visualization.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>str</em>– The display-symbol to use. This must visually be a single character
but could have color markers, use a unicode font etc.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>By default, just setting .display_symbol is enough.</p>
<codeclass="sig-name descname">multilink</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartRerouterMapLink.multilink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_direction</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartRerouterMapLink.get_direction"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartRerouterMapLink.get_direction"title="Permalink to this definition">¶</a></dt>
<dd><p>Dynamically determine the direction based on a source direction and grid topology.</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.grid.xyzgrid.xymap_legend.</code><codeclass="sig-name descname">SmartTeleporterMapLink</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartTeleporterMapLink"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 't'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = ' '</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">direction_name</code><emclass="property"> = 'teleport'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.direction_name"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartTeleporterMapLink.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.__init__"title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize the link.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>x</strong> (<em>int</em>) – The xygrid x coordinate</p></li>
<li><p><strong>y</strong> (<em>int</em>) – The xygrid y coordinate.</p></li>
<li><p><strong>X</strong> (<em>int</em><em> or </em><em>str</em>) – The name/Z-coord of this map we are on.</p></li>
<li><p><strong>symbol</strong> (<em>str</em><em>, </em><em>optional</em>) – Set during parsing, allows to override
the default symbol with the one set in the legend.</p></li>
<li><p><strong>xymap</strong> (<aclass="reference internal"href="evennia.contrib.grid.xyzgrid.xymap.html#evennia.contrib.grid.xyzgrid.xymap.XYMap"title="evennia.contrib.grid.xyzgrid.xymap.XYMap"><em>XYMap</em></a><em>, </em><em>optional</em>) – The map object this sits on.</p></li>
<codeclass="sig-name descname">at_empty_target</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em>, <emclass="sig-param"><spanclass="n">end_direction</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartTeleporterMapLink.at_empty_target"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.at_empty_target"title="Permalink to this definition">¶</a></dt>
<dd><p>Called during traversal, when finding an unknown direction out of the link (same as
targeting a link at an empty spot on the grid). This will also search for
a unique, matching teleport to send to.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>start_direction</strong> (<em>str</em>) – The direction (n, ne etc) from which this traversal originates
for this link.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>TeleporterMapLink</em>– The paired teleporter.</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><aclass="reference internal"href="evennia.contrib.grid.xyzgrid.utils.html#evennia.contrib.grid.xyzgrid.utils.MapParserError"title="evennia.contrib.grid.xyzgrid.utils.MapParserError"><strong>MapParserError</strong></a>– We raise this explicitly rather than returning <strong>None</strong> if we don’t find
another teleport. This avoids us getting the default (and in this case confusing)
‘pointing to an empty space’ error we’d get if returning <strong>None</strong>.</p>
<codeclass="sig-name descname">get_direction</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartTeleporterMapLink.get_direction"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartTeleporterMapLink.get_direction"title="Permalink to this definition">¶</a></dt>
<dd><p>Figure out the connected link and paired teleport.</p>
<codeclass="sig-name descname">multilink</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartMapLink.multilink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_direction</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">start_direction</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#SmartMapLink.get_direction"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SmartMapLink.get_direction"title="Permalink to this definition">¶</a></dt>
<dd><p>Figure out the direction from a specific source direction based on grid topology.</p>
<codeclass="sig-name descname">get_display_symbol</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#InvisibleSmartMapLink.get_display_symbol"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InvisibleSmartMapLink.get_display_symbol"title="Permalink to this definition">¶</a></dt>
<dd><p>The SmartMapLink already calculated the directions before this, so we
just need to figure out what to replace this with in order to make this ‘invisible’</p>
<p>Depending on how we are connected, we figure out how the ‘normal’ link
<codeclass="sig-name descname">symbol</code><emclass="property"> = '#'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.BasicMapNode.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_room'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.BasicMapNode.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'I'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapNode.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = '#'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapNode.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">interrupt_path</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapNode.interrupt_path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_room'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapNode.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'T'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapTransitionNode.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = ' '</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapTransitionNode.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = None</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapTransitionNode.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">target_map_xyz</code><emclass="property"> = (None, None, None)</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.MapTransitionNode.target_map_xyz"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '|'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">display_symbol</code><emclass="property"> = '||'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSMapLink.display_symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'n': 's', 's': 'n'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '-'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'e': 'w', 'w': 'e'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '/'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NESWMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'ne': 'sw', 'sw': 'ne'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NESWMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NESWMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '\\'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SENWMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'nw': 'se', 'se': 'nw'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SENWMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SENWMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '+'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.PlusMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.PlusMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'x'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.CrossMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.CrossMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'v'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSOneWayMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'n': 's'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSOneWayMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.NSOneWayMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '^'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SNOneWayMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'s': 'n'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SNOneWayMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.SNOneWayMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '<'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWOneWayMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'e': 'w'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWOneWayMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.EWOneWayMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = '>'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.WEOneWayMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">directions</code><emclass="property"> = {'w': 'e'}</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.WEOneWayMapLink.directions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.WEOneWayMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'u'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.UpMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.UpMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'd'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.DownMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.DownMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'i'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">interrupt_path</code><emclass="property"> = True</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapLink.interrupt_path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.InterruptMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'b'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.BlockedMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">prototype</code><emclass="property"> = 'xyz_exit'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.BlockedMapLink.prototype"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 'o'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.RouterMapLink.symbol"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.contrib.grid.xyzgrid.xymap_legend.</code><codeclass="sig-name descname">TeleporterMapLink</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/contrib/grid/xyzgrid/xymap_legend.html#TeleporterMapLink"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TeleporterMapLink"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">symbol</code><emclass="property"> = 't'</em><aclass="headerlink"href="#evennia.contrib.grid.xyzgrid.xymap_legend.TeleporterMapLink.symbol"title="Permalink to this definition">¶</a></dt>