<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharset="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>EggHatchData | pokemon-rogue-battle</title><metaname="description"content="Documentation for pokemon-rogue-battle"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="../assets/style.css"/><linkrel="stylesheet"href="../assets/highlight.css"/><scriptdefersrc="../assets/main.js"></script><scriptasyncsrc="../assets/icons.js"id="tsd-icons-script"></script><scriptasyncsrc="../assets/search.js"id="tsd-search-script"></script><scriptasyncsrc="../assets/navigation.js"id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme=localStorage.getItem("tsd-theme")||"os";document.body.style.display="none";setTimeout(()=>app?app.showPage():document.body.style.removeProperty("display"),500)</script><headerclass="tsd-page-toolbar"><divclass="tsd-toolbar-contents container"><divclass="table-cell"id="tsd-search"data-base=".."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget tsd-toolbar-icon search no-caption"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-search"></use></svg></label><inputtype="text"id="tsd-search-field"aria-label="Search"/></div><divclass="field"><divid="tsd-toolbar-links"></div></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="../index.html"class="title">pokemon-rogue-battle</a></div><divclass="table-cell"id="tsd-widgets"><ahref="#"class="tsd-widget tsd-toolbar-icon menu no-caption"data-toggle="menu"aria-label="Menu"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><divclass="container container-main"><divclass="col-content"><divclass="tsd-page-title"><ulclass="tsd-breadcrumb"><li><ahref="../index.html">pokemon-rogue-battle</a></li><li><ahref="../modules/data_egg_hatch_data.html">data/egg-hatch-data</a></li><li><ahref="data_egg_hatch_data.EggHatchData.html">EggHatchData</a></li></ul><h1>Class EggHatchData</h1></div><sectionclass="tsd-panel tsd-comment"><divclass="tsd-comment tsd-typography"><p>Stores data associated with a specific egg and the hatched pokemon
Allows hatch info to be stored at hatch then retrieved for display during egg summary</p>
</div></section></div></details></section></section><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Constructors"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><sectionclass="tsd-panel tsd-member"><aid="constructor"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>constructor</span><ahref="#constructor"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="constructor.new_EggHatchData"class="tsd-anchor"></a><spanclass="tsd-kind-constructor-signature">new <wbr/>Egg<wbr/>Hatch<wbr/>Data</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">scene</span>, <spanclass="tsd-kind-parameter">pokemon</span>, <spanclass="tsd-kind-parameter">eggMoveIndex</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="data_egg_hatch_data.EggHatchData.html"class="tsd-signature-type tsd-kind-class">EggHatchData</a><ahref="#constructor.new_EggHatchData"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">scene</span>: <ahref="battle_scene.default.html"class="tsd-signature-type tsd-kind-class">default</a></span></li><li><span><spanclass="tsd-kind-parameter">pokemon</span>: <ahref="field_pokemon.PlayerPokemon.html"class="tsd-signature-type tsd-kind-class">PlayerPokemon</a></span></li><li><span><spanclass="tsd-kind-parameter">eggMoveIndex</span>: <spanclass="tsd-signature-type">number</span></span></li></ul></div><h4class="tsd-returns-title">Returns <ahref="data_egg_hatch_data.EggHatchData.html"class="tsd-signature-type tsd-kind-class">EggHatchData</a></h4><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L23">src/data/egg-hatch-data.ts:23</a></li></ul></aside></li></ul></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Properties"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><sectionclass="tsd-panel tsd-member"><aid="dexEntryBeforeUpdate"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>dex<wbr/>Entry<wbr/>Before<wbr/>Update</span><ahref="#dexEntryBeforeUpdate"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">dex<wbr/>Entry<wbr/>Before<wbr/>Update</span><spanclass="tsd-signature-symbol">:</span><ahref="../interfaces/system_game_data.DexEntry.html"class="tsd-signature-type tsd-kind-interface">DexEntry</a></div><divclass="tsd-comment tsd-typography"><p>stored copy of the hatched pokemon's dex entry before it was updated due to hatch</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L17">src/data/egg-hatch-data.ts:17</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="eggMoveIndex"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>egg<wbr/>Move<wbr/>Index</span><ahref="#eggMoveIndex"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">egg<wbr/>Move<wbr/>Index</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">number</span></div><divclass="tsd-comment tsd-typography"><p>index of the egg move from the hatched pokemon (not stored in PlayerPokemon)</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L13">src/data/egg-hatch-data.ts:13</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="eggMoveUnlocked"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>egg<wbr/>Move<wbr/>Unlocked</span><ahref="#eggMoveUnlocked"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">egg<wbr/>Move<wbr/>Unlocked</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">boolean</span></div><divclass="tsd-comment tsd-typography"><p>boolean indicating if the egg move for the hatch is new</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L15">src/data/egg-hatch-data.ts:15</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="pokemon"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>pokemon</span><ahref="#pokemon"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">pokemon</span><spanclass="tsd-signature-symbol">:</span><ahref="field_pokemon.PlayerPokemon.html"class="tsd-signature-type tsd-kind-class">PlayerPokemon</a></div><divclass="tsd-comment tsd-typography"><p>the pokemon that hatched from the file (including shiny, IVs, ability)</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L11">src/data/egg-hatch-data.ts:11</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="starterDataEntryBeforeUpdate"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>starter<wbr/>Data<wbr/>Entry<wbr/>Before<wbr/>Update</span><ahref="#starterDataEntryBeforeUpdate"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">starter<wbr/>Data<wbr/>Entry<wbr/>Before<wbr/>Update</span><spanclass="tsd-signature-symbol">:</span><ahref="../interfaces/system_game_data.StarterDataEntry.html"class="tsd-signature-type tsd-kind-interface">StarterDataEntry</a></div><divclass="tsd-comment tsd-typography"><p>stored copy of the hatched pokemon's starter entry before it was updated due to hatch</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L19">src/data/egg-hatch-data.ts:19</a></li></ul></aside></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Methods"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><sectionclass="tsd-panel tsd-member"><aid="getDex"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>get<wbr/>Dex</span><ahref="#getDex"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getDex.getDex-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Dex</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="../interfaces/system_game_data.DexEntry.html"class="tsd-signature-type tsd-kind-interface">DexEntry</a><ahref="#getDex.getDex-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Gets the dex entry before update</p>
</div><h4class="tsd-returns-title">Returns <ahref="../interfaces/system_game_data.DexEntry.html"class="tsd-signature-type tsd-kind-interface">DexEntry</a></h4><p>Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex</p>
</div><h4class="tsd-returns-title">Returns <ahref="../interfaces/system_game_data.StarterDataEntry.html"class="tsd-signature-type tsd-kind-interface">StarterDataEntry</a></h4><p>Starter Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L77">src/data/egg-hatch-data.ts:77</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="setDex"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>set<wbr/>Dex</span><ahref="#setDex"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="setDex.setDex-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">set<wbr/>Dex</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#setDex.setDex-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Stores a copy of the current DexEntry of the pokemon and StarterDataEntry of its starter
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L41">src/data/egg-hatch-data.ts:41</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="setEggMoveUnlocked"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>set<wbr/>Egg<wbr/>Move<wbr/>Unlocked</span><ahref="#setEggMoveUnlocked"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="setEggMoveUnlocked.setEggMoveUnlocked-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">set<wbr/>Egg<wbr/>Move<wbr/>Unlocked</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">unlocked</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#setEggMoveUnlocked.setEggMoveUnlocked-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Sets the boolean for if the egg move for the hatch is a new unlock</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">unlocked</span>: <spanclass="tsd-signature-type">boolean</span></span><divclass="tsd-comment tsd-typography"><p>True if the EM is new</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/0c920ba195c8fa8470694f5a1f4b3157438aa256/src/data/egg-hatch-data.ts#L33">src/data/egg-hatch-data.ts:33</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="updatePokemon"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>update<wbr/>Pokemon</span><ahref="#updatePokemon"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="updatePokemon.updatePokemon-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">update<wbr/>Pokemon</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">showMessage</span><spanclass="tsd-signature-symbol">?</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span><ahref="#updatePokemon.updatePokemon-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Update the pokedex data corresponding with the new hatch's pokemon data
Also sets whether the egg move is a new unlock or not</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">showMessage</span>: <spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol"> = false</span></span><divclass="tsd-comment tsd-typography"><p>boolean to show messages for the new catches and egg moves (false by default)</p>