# EggHatchData | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class EggHatchData

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

- Defined in src/data/egg-hatch-data.ts:9

##### Index

### Constructors

constructor

### Properties

dexEntryBeforeUpdate
eggMoveIndex
eggMoveUnlocked
pokemon
starterDataEntryBeforeUpdate

### Methods

getDex
getStarterEntry
setDex
setEggMoveUnlocked
updatePokemon

## Constructors

### constructor

- new EggHatchData(pokemon: PlayerPokemon , eggMoveIndex: number): EggHatchData

  #### Parameters

  - pokemon: PlayerPokemon
  - eggMoveIndex: number

  #### Returns EggHatchData

  - Defined in src/data/egg-hatch-data.ts:21

## Properties

### dexEntryBeforeUpdate

dexEntryBeforeUpdate: DexEntry

stored copy of the hatched pokemon's dex entry before it was updated due to hatch

- Defined in src/data/egg-hatch-data.ts:17

### eggMoveIndex

eggMoveIndex: number

index of the egg move from the hatched pokemon (not stored in PlayerPokemon)

- Defined in src/data/egg-hatch-data.ts:13

### eggMoveUnlocked

eggMoveUnlocked: boolean

boolean indicating if the egg move for the hatch is new

- Defined in src/data/egg-hatch-data.ts:15

### pokemon

pokemon: PlayerPokemon

the pokemon that hatched from the file (including shiny, IVs, ability)

- Defined in src/data/egg-hatch-data.ts:11

### starterDataEntryBeforeUpdate

starterDataEntryBeforeUpdate: StarterDataEntry

stored copy of the hatched pokemon's starter entry before it was updated due to hatch

- Defined in src/data/egg-hatch-data.ts:19

## Methods

### getDex

- getDex(): DexEntry

  Gets the dex entry before update

  #### Returns DexEntry

  Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex

  - Defined in src/data/egg-hatch-data.ts:66

### getStarterEntry

- getStarterEntry(): StarterDataEntry

  Gets the starter dex entry before update

  #### Returns StarterDataEntry

  Starter Dex Entry corresponding to this pokemon before the pokemon was added / updated to dex

  - Defined in src/data/egg-hatch-data.ts:74

### setDex

- setDex(): void

  Stores a copy of the current DexEntry of the pokemon and StarterDataEntry of its starter Used before updating the dex, so comparing the pokemon to these entries will show the new attributes

  #### Returns void

  - Defined in src/data/egg-hatch-data.ts:38

### setEggMoveUnlocked

- setEggMoveUnlocked(unlocked: boolean): void

  Sets the boolean for if the egg move for the hatch is a new unlock

  #### Parameters

  - unlocked: boolean

    True if the EM is new

  #### Returns void

  - Defined in src/data/egg-hatch-data.ts:30

### updatePokemon

- updatePokemon(showMessage?: boolean): Promise<void>

  Update the pokedex data corresponding with the new hatch's pokemon data Also sets whether the egg move is a new unlock or not

  #### Parameters

  - showMessage: boolean = false

    boolean to show messages for the new catches and egg moves (false by default)

  #### Returns Promise<void>

  - Defined in src/data/egg-hatch-data.ts:84