profectus-docs/assets/api_game_events_interfaces_GlobalEvents.md.D6zjGE6r.lean.js

2 lines
11 KiB
JavaScript
Raw Normal View History

import{_ as a,c as r,a0 as t,o}from"./chunks/framework.P9qPzDnn.js";const f=JSON.parse('{"title":"Interface: GlobalEvents","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/events/interfaces/GlobalEvents.md","filePath":"api/game/events/interfaces/GlobalEvents.md","lastUpdated":null}'),n={name:"api/game/events/interfaces/GlobalEvents.md"};function s(i,e,d,l,c,h){return o(),r("div",null,e[0]||(e[0]=[t('<p><a href="./../../../">Profectus</a> / <a href="./../">game/events</a> / GlobalEvents</p><h1 id="interface-globalevents" tabindex="-1">Interface: GlobalEvents <a class="header-anchor" href="#interface-globalevents" aria-label="Permalink to &quot;Interface: GlobalEvents&quot;"></a></h1><p>All types of events able to be sent or emitted from the global event bus.</p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to &quot;Properties&quot;"></a></h2><h3 id="addlayer" tabindex="-1">addLayer() <a class="header-anchor" href="#addlayer" aria-label="Permalink to &quot;addLayer()&quot;"></a></h3><blockquote><p><strong>addLayer</strong>: (<code>layer</code>, <code>saveData</code>) =&gt; <code>void</code></p></blockquote><p>Sent whenever a layer is added.</p><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="layer" tabindex="-1">layer <a class="header-anchor" href="#layer" aria-label="Permalink to &quot;layer&quot;"></a></h5><p><a href="./../../layers/interfaces/Layer"><code>Layer</code></a></p><p>The layer being added.</p><h5 id="savedata" tabindex="-1">saveData <a class="header-anchor" href="#savedata" aria-label="Permalink to &quot;saveData&quot;"></a></h5><p><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>unknown</code>&gt;</p><p>The layer&#39;s save data object within player.</p><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L14" target="_blank" rel="noreferrer">profectus/src/game/events.ts:14</a></p><hr><h3 id="fontsloaded" tabindex="-1">fontsLoaded <a class="header-anchor" href="#fontsloaded" aria-label="Permalink to &quot;fontsLoaded&quot;"></a></h3><blockquote><p><strong>fontsLoaded</strong>: <code>VoidFunction</code></p></blockquote><p>Using document.fonts.ready returns too early on firefox, so we use document.fonts.onloadingdone instead, which doesn&#39;t accept multiple listeners. This event fires when that callback is called.</p><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L51" target="_blank" rel="noreferrer">profectus/src/game/events.ts:51</a></p><hr><h3 id="gamewon" tabindex="-1">gameWon <a class="header-anchor" href="#gamewon" aria-label="Permalink to &quot;gameWon&quot;"></a></h3><blockquote><p><strong>gameWon</strong>: <code>VoidFunction</code></p></blockquote><p>Sent when the game has ended.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L35" target="_blank" rel="noreferrer">profectus/src/game/events.ts:35</a></p><hr><h3 id="loadsettings" tabindex="-1">loadSettings() <a class="header-anchor" href="#loadsettings" aria-label="Permalink to &quot;loadSettings()&quot;"></a></h3><blockquote><p><stron