Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
PokemonDBEntry Struct Reference

One species' complete static data – the richest entry in the db layer. More...

#include <pokemon.h>

Collaboration diagram for PokemonDBEntry:

Public Member Functions

 PokemonDBEntry ()
 Empty species.
 PokemonDBEntry (QJsonValue &data)
 Build from a JSON value.
void deepLink ()
 Resolve the full cross-reference web (the to* members).

Public Attributes

QString name
 Internal species name (key).
var8 ind = 0
 Internal species index.
QString readable
 Human-readable species name.
bool glitch = false
 Whether this is a glitch species.
QString type1
 Primary type name (resolved to toType1).
QString type2
 Secondary type name (resolved to toType2).
QVector< PokemonDBEntryMove * > moves
 Level-up learnset.
QVector< QString > initial
 Moves known at capture (resolved to toInitial).
QVector< var8tmHm
 TM/HM numbers it can learn.
QVector< PokemonDBEntryEvolution * > evolution
 Evolution edges.
std::optional< var8pokedex
 Pokedex number, if assigned.
std::optional< var8growthRate
 EXP growth-rate group.
std::optional< var8baseHp
 Base HP.
std::optional< var8baseAttack
 Base Attack.
std::optional< var8baseDefense
 Base Defense.
std::optional< var8baseSpeed
 Base Speed.
std::optional< var8baseSpecial
 Base Special.
std::optional< var8baseExpYield
 Base EXP yield.
std::optional< var8catchRate
 Catch rate.
TypeDBEntrytoType1 = nullptr
 Resolved primary type.
TypeDBEntrytoType2 = nullptr
 Resolved secondary type.
PokemonDBEntrytoDeEvolution = nullptr
 Resolved pre-evolution.
QVector< MoveDBEntry * > toInitial
 Resolved capture moves.
QVector< MoveDBEntry * > toTmHmMove
 Resolved TM/HM moves.
QVector< ItemDBEntry * > toTmHmItem
 Resolved TM/HM items.
QVector< EventPokemonDBEntry * > toEventMons
 Event distributions of this species.
MapDBEntrySpritePokemontoMapSpritePokemon = nullptr
 On-map static-Pokemon sprite, if any.
QVector< MapDBEntryWildMon * > toWildMonMaps
 Maps where it appears wild.
QVector< TradeDBEntry * > toTrades
 In-game trades giving/getting it.
QVector< GameCornerDBEntry * > toGameCorner
 Game Corner prizes of this species.

Detailed Description

One species' complete static data – the richest entry in the db layer.

Holds the base stats, types, learnset (moves / initial / tmHm), and evolution edges, all loaded from JSON. deepLink() then wires up a large web of cross-references (the to* members): types, learnable moves, TM/HM moves+items, plus back-references to where the species appears – events, on-map sprites, wild-encounter maps, trades, and Game Corner prizes. The std::optional base-stat fields are absent for entries that don't define them (e.g. glitch mons).

See also
PokemonDB, PokemonBox (the save-side mon), db.md for the entry/deepLink convention.

Definition at line 98 of file pokemon.h.

Constructor & Destructor Documentation

◆ PokemonDBEntry() [1/2]

PokemonDBEntry::PokemonDBEntry ( )

Empty species.

Definition at line 94 of file pokemon.cpp.

◆ PokemonDBEntry() [2/2]

PokemonDBEntry::PokemonDBEntry ( QJsonValue & data)

Build from a JSON value.

Definition at line 95 of file pokemon.cpp.

References baseAttack, baseDefense, baseExpYield, baseHp, baseSpecial, baseSpeed, catchRate, evolution, glitch, growthRate, ind, initial, moves, name, pokedex, readable, tmHm, type1, and type2.

Member Function Documentation

◆ deepLink()

void PokemonDBEntry::deepLink ( )

Resolve the full cross-reference web (the to* members).

Definition at line 135 of file pokemon.cpp.

References evolution, ItemsDB::getIndAt(), MovesDB::getIndAt(), TypesDB::getIndAt(), initial, ItemsDB::inst(), MovesDB::inst(), TypesDB::inst(), moves, tmHm, toInitial, toTmHmItem, toTmHmMove, toType1, toType2, type1, and type2.

Member Data Documentation

◆ baseAttack

std::optional<var8> PokemonDBEntry::baseAttack

Base Attack.

Definition at line 118 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ baseDefense

std::optional<var8> PokemonDBEntry::baseDefense

Base Defense.

Definition at line 119 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ baseExpYield

std::optional<var8> PokemonDBEntry::baseExpYield

Base EXP yield.

Definition at line 122 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ baseHp

std::optional<var8> PokemonDBEntry::baseHp

Base HP.

Definition at line 117 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ baseSpecial

std::optional<var8> PokemonDBEntry::baseSpecial

Base Special.

Definition at line 121 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ baseSpeed

std::optional<var8> PokemonDBEntry::baseSpeed

Base Speed.

Definition at line 120 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ catchRate

std::optional<var8> PokemonDBEntry::catchRate

Catch rate.

Definition at line 123 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ evolution

QVector<PokemonDBEntryEvolution*> PokemonDBEntry::evolution

Evolution edges.

Definition at line 113 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().

◆ glitch

bool PokemonDBEntry::glitch = false

Whether this is a glitch species.

Definition at line 106 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ growthRate

std::optional<var8> PokemonDBEntry::growthRate

EXP growth-rate group.

Definition at line 116 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ ind

var8 PokemonDBEntry::ind = 0

Internal species index.

Definition at line 104 of file pokemon.h.

Referenced by PokemonBox::newPokemon(), PokemonDBEntry(), Rival::randomize(), and PlayerBasics::randomizeStarter().

◆ initial

QVector<QString> PokemonDBEntry::initial

Moves known at capture (resolved to toInitial).

Definition at line 111 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().

◆ moves

QVector<PokemonDBEntryMove*> PokemonDBEntry::moves

Level-up learnset.

Definition at line 110 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().

◆ name

QString PokemonDBEntry::name

Internal species name (key).

Definition at line 103 of file pokemon.h.

Referenced by PokemonBox::changeName(), and PokemonDBEntry().

◆ pokedex

std::optional<var8> PokemonDBEntry::pokedex

Pokedex number, if assigned.

Definition at line 115 of file pokemon.h.

Referenced by MoveSelectModel::monFromBox(), and PokemonDBEntry().

◆ readable

QString PokemonDBEntry::readable

Human-readable species name.

Definition at line 105 of file pokemon.h.

Referenced by PokemonDBEntry().

◆ tmHm

QVector<var8> PokemonDBEntry::tmHm

TM/HM numbers it can learn.

Definition at line 112 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().

◆ toDeEvolution

PokemonDBEntry* PokemonDBEntry::toDeEvolution = nullptr

Resolved pre-evolution.

Definition at line 127 of file pokemon.h.

◆ toEventMons

QVector<EventPokemonDBEntry*> PokemonDBEntry::toEventMons

Event distributions of this species.

Definition at line 131 of file pokemon.h.

◆ toGameCorner

QVector<GameCornerDBEntry*> PokemonDBEntry::toGameCorner

Game Corner prizes of this species.

Definition at line 135 of file pokemon.h.

◆ toInitial

QVector<MoveDBEntry*> PokemonDBEntry::toInitial

Resolved capture moves.

Definition at line 128 of file pokemon.h.

Referenced by deepLink().

◆ toMapSpritePokemon

MapDBEntrySpritePokemon* PokemonDBEntry::toMapSpritePokemon = nullptr

On-map static-Pokemon sprite, if any.

Definition at line 132 of file pokemon.h.

◆ toTmHmItem

QVector<ItemDBEntry*> PokemonDBEntry::toTmHmItem

Resolved TM/HM items.

Definition at line 130 of file pokemon.h.

Referenced by deepLink().

◆ toTmHmMove

QVector<MoveDBEntry*> PokemonDBEntry::toTmHmMove

Resolved TM/HM moves.

Definition at line 129 of file pokemon.h.

Referenced by deepLink().

◆ toTrades

QVector<TradeDBEntry*> PokemonDBEntry::toTrades

In-game trades giving/getting it.

Definition at line 134 of file pokemon.h.

◆ toType1

TypeDBEntry* PokemonDBEntry::toType1 = nullptr

Resolved primary type.

Definition at line 125 of file pokemon.h.

Referenced by deepLink().

◆ toType2

TypeDBEntry* PokemonDBEntry::toType2 = nullptr

Resolved secondary type.

Definition at line 126 of file pokemon.h.

Referenced by deepLink().

◆ toWildMonMaps

QVector<MapDBEntryWildMon*> PokemonDBEntry::toWildMonMaps

Maps where it appears wild.

Definition at line 133 of file pokemon.h.

◆ type1

QString PokemonDBEntry::type1

Primary type name (resolved to toType1).

Definition at line 107 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().

◆ type2

QString PokemonDBEntry::type2

Secondary type name (resolved to toType2).

Definition at line 108 of file pokemon.h.

Referenced by deepLink(), and PokemonDBEntry().


The documentation for this struct was generated from the following files: