profectus-docs/assets/api_game_boards_board_functions_placeInAvailableSpace.md.D_XASdNm.js

1 line
3.2 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as a,c as o,a0 as r,o as t}from"./chunks/framework.P9qPzDnn.js";const u=JSON.parse('{"title":"Function: placeInAvailableSpace()","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/boards/board/functions/placeInAvailableSpace.md","filePath":"api/game/boards/board/functions/placeInAvailableSpace.md","lastUpdated":null}'),n={name:"api/game/boards/board/functions/placeInAvailableSpace.md"};function i(d,e,c,s,l,p){return t(),o("div",null,e[0]||(e[0]=[r('<p><a href="./../../../../">Profectus</a> / <a href="./../">game/boards/board</a> / placeInAvailableSpace</p><h1 id="function-placeinavailablespace" tabindex="-1">Function: placeInAvailableSpace() <a class="header-anchor" href="#function-placeinavailablespace" aria-label="Permalink to &quot;Function: placeInAvailableSpace()&quot;"></a></h1><blockquote><p><strong>placeInAvailableSpace</strong>&lt;<code>T</code>&gt;(<code>nodeToPlace</code>, <code>nodes</code>, <code>radius</code>, <code>direction</code>): <code>void</code></p></blockquote><p>Moves a node so that it is sufficiently far away from any other nodes, to prevent overlapping.</p><h2 id="type-parameters" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to &quot;Type Parameters&quot;"></a></h2><p>• <strong>T</strong> <em>extends</em> <a href="./../type-aliases/NodePosition"><code>NodePosition</code></a></p><h2 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h2><h3 id="nodetoplace" tabindex="-1">nodeToPlace <a class="header-anchor" href="#nodetoplace" aria-label="Permalink to &quot;nodeToPlace&quot;"></a></h3><p><code>T</code></p><p>The node to find a spot for, with it&#39;s current/preffered position.</p><h3 id="nodes" tabindex="-1">nodes <a class="header-anchor" href="#nodes" aria-label="Permalink to &quot;nodes&quot;"></a></h3><p><code>T</code>[]</p><p>The list of nodes to make sure nodeToPlace is far enough away from.</p><h3 id="radius" tabindex="-1">radius <a class="header-anchor" href="#radius" aria-label="Permalink to &quot;radius&quot;"></a></h3><p><code>number</code> = <code>100</code></p><p>How far away nodeToPlace must be from any other nodes.</p><h3 id="direction" tabindex="-1">direction <a class="header-anchor" href="#direction" aria-label="Permalink to &quot;direction&quot;"></a></h3><p><a href="./../../../../util/common/enumerations/Direction"><code>Direction</code></a> = <code>Direction.Right</code></p><p>The direction to push the nodeToPlace until it finds an available spot.</p><h2 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h2><p><code>void</code></p><h2 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></a></h2><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L406" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:406</a></p>',23)]))}const f=a(n,[["render",i]]);export{u as __pageData,f as default};