import{_ase,casa,oast,aasn}from"./app.54d5a277.js";constf='{"title":"Project Entry","description":"","frontmatter":{},"headers":[{"level":2,"title":"Required Exports","slug":"required-exports"},{"level":3,"title":"getInitialLayers","slug":"getinitiallayers"},{"level":3,"title":"hasWon","slug":"haswon"},{"level":3,"title":"fixOldSave","slug":"fixoldsave"}],"relativePath":"guide/project-entry.md"}',s={},o=n(`<h1 id="project-entry" tabindex="-1">Project Entry <a class="header-anchor" href="#project-entry" aria-hidden="true">#</a></h1><p>This is a TypeScript file containing the non-static parts of your project, and acts as the entry point for it.</p><p>It is stored at <code>/src/data/projEntry.jsx</code>.</p><p>This file has 3 things it must export, but beyond that can export anything the creator wants it to. Typically in addition to the required 3, the initial/"main" layer will be exported. Typically utilites belong in <code>common.tsx</code>, which exists next to <code>projEntry.tsx</code>.</p><h2 id="required-exports" tabindex="-1">Required Exports <a class="header-anchor" href="#required-exports" aria-hidden="true">#</a></h2><h3 id="getinitiallayers" tabindex="-1">getInitialLayers <a class="header-anchor" href="#getinitiallayers" aria-hidden="true">#</a></h3><ul><li>Type: <code>(player: Partial<PlayerData>) => GenericLayer[]</code></li></ul><p>A function that is given a player save data object currently being loaded, and returns a list of layers that should be active for that player. If a project does not have dynamic layers, this should always return a list of all layers.</p><h3 id="haswon" tabindex="-1">hasWon <a class="header-anchor" href="#haswon" aria-hidden="true">#</a></h3><ul><li>Type: <code>ComputedRef<boolean></code></li></ul><p>A computed ref whose value is true whenever the game is over.</p><p>For example, in a game where the goal is to have a resource reach 10:</p><div class="language-ts"><pre><code><span class="token keyword">export</span> <span class="token keyword">const</span> hasWon <span class="token operator">=</span> <span class="token function">computed</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> Decimal<span class="token punctuation">.</span><span class="token function">gte</span><span class="token punctuation">(</span>resource<span class="token punctuation">.</span>value<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>