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

One move's static data (type, power, accuracy, PP, TM/HM), with links. More...

#include <moves.h>

Collaboration diagram for MoveDBEntry:

Public Member Functions

 MoveDBEntry ()
 Empty entry.
 MoveDBEntry (QJsonValue &data)
 Build from a JSON value.
void deepLink ()
 Resolve cross-DB links (type, item) after load.

Public Attributes

QString name
 Internal move name (key).
var8 ind = 0
 Move index/id.
bool glitch = false
 Whether this is a glitch move.
QString type
 Type name (resolved to toType).
QString readable
 Human-readable display name.
std::optional< var8power
 Base power, if any.
std::optional< var8accuracy
 Accuracy, if any.
std::optional< var8pp
 Base PP, if any.
std::optional< var8tm
 TM number teaching this move, if any.
std::optional< var8hm
 HM number teaching this move, if any.
TypeDBEntrytoType = nullptr
 Resolved type entry (deepLink).
ItemDBEntrytoItem = nullptr
 Resolved TM/HM item entry (deepLink).
QVector< struct PokemonDBEntryMove * > toPokemonLearned
 Mons that learn this by level-up.
QVector< struct PokemonDBEntry * > toPokemonInitial
 Mons that start with this move.
QVector< struct PokemonDBEntry * > toPokemonTmHm
 Mons that can learn it via TM/HM.

Detailed Description

One move's static data (type, power, accuracy, PP, TM/HM), with links.

A "plain struct" DB entry (the other entry style – contrast the QObject-getter style of CreditDBEntry): fields are public and read directly. The std::optional fields are absent for moves that don't have them. The to* pointers are resolved in deepLink() once all DBs are loaded – toType / toItem forward, and the toPokemon* vectors are back-references filled in during PokemonDB's deep-link.

See also
MovesDB (its database), db.md for the entry/deepLink convention.

Definition at line 46 of file moves.h.

Constructor & Destructor Documentation

◆ MoveDBEntry() [1/2]

MoveDBEntry::MoveDBEntry ( )

Empty entry.

Definition at line 35 of file moves.cpp.

◆ MoveDBEntry() [2/2]

MoveDBEntry::MoveDBEntry ( QJsonValue & data)

Build from a JSON value.

Definition at line 36 of file moves.cpp.

References accuracy, glitch, hm, ind, name, power, pp, readable, tm, and type.

Member Function Documentation

◆ deepLink()

void MoveDBEntry::deepLink ( )

Resolve cross-DB links (type, item) after load.

Definition at line 51 of file moves.cpp.

References ItemsDB::getIndAt(), TypesDB::getIndAt(), hm, ItemsDB::inst(), TypesDB::inst(), name, tm, toItem, toType, and type.

Member Data Documentation

◆ accuracy

std::optional<var8> MoveDBEntry::accuracy

Accuracy, if any.

Definition at line 58 of file moves.h.

Referenced by MoveDBEntry().

◆ glitch

bool MoveDBEntry::glitch = false

Whether this is a glitch move.

Definition at line 53 of file moves.h.

Referenced by PokemonMove::isInvalid(), MoveDBEntry(), and PokemonMove::randomize().

◆ hm

std::optional<var8> MoveDBEntry::hm

HM number teaching this move, if any.

Definition at line 61 of file moves.h.

Referenced by deepLink(), and MoveDBEntry().

◆ ind

var8 MoveDBEntry::ind = 0

Move index/id.

Definition at line 52 of file moves.h.

Referenced by MoveDBEntry(), and PokemonMove::randomize().

◆ name

QString MoveDBEntry::name

Internal move name (key).

Definition at line 51 of file moves.h.

Referenced by deepLink(), and MoveDBEntry().

◆ power

std::optional<var8> MoveDBEntry::power

Base power, if any.

Definition at line 57 of file moves.h.

Referenced by MoveDBEntry().

◆ pp

std::optional<var8> MoveDBEntry::pp

Base PP, if any.

Definition at line 59 of file moves.h.

Referenced by MoveDBEntry().

◆ readable

QString MoveDBEntry::readable

Human-readable display name.

Definition at line 55 of file moves.h.

Referenced by MoveDBEntry().

◆ tm

std::optional<var8> MoveDBEntry::tm

TM number teaching this move, if any.

Definition at line 60 of file moves.h.

Referenced by deepLink(), and MoveDBEntry().

◆ toItem

ItemDBEntry* MoveDBEntry::toItem = nullptr

Resolved TM/HM item entry (deepLink).

Definition at line 64 of file moves.h.

Referenced by deepLink().

◆ toPokemonInitial

QVector<struct PokemonDBEntry*> MoveDBEntry::toPokemonInitial

Mons that start with this move.

Definition at line 68 of file moves.h.

◆ toPokemonLearned

QVector<struct PokemonDBEntryMove*> MoveDBEntry::toPokemonLearned

Mons that learn this by level-up.

Definition at line 67 of file moves.h.

◆ toPokemonTmHm

QVector<struct PokemonDBEntry*> MoveDBEntry::toPokemonTmHm

Mons that can learn it via TM/HM.

Definition at line 69 of file moves.h.

◆ toType

TypeDBEntry* MoveDBEntry::toType = nullptr

Resolved type entry (deepLink).

Definition at line 63 of file moves.h.

Referenced by deepLink(), and PokemonMove::moveType().

◆ type

QString MoveDBEntry::type

Type name (resolved to toType).

Definition at line 54 of file moves.h.

Referenced by deepLink(), and MoveDBEntry().


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