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

One story-event definition: its name and where its flag lives in the save. More...

#include <eventdbentry.h>

Inheritance diagram for EventDBEntry:
Collaboration diagram for EventDBEntry:

Public Member Functions

const QString getName () const
 < Event name.
int getInd () const
int getByte () const
int getBit () const
const QVector< QString > getMaps () const
 Associated map names.
int getMapsSize () const
const QString getMapAt (int ind) const
 Associated map name ind (for QML).
const QVector< MapDBEntry * > getToMaps () const
 Resolved associated maps.
int getToMapsSize () const
const MapDBEntrygetToMapAt (int ind) const
 Resolved map ind (for QML).
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Protected Member Functions

 EventDBEntry ()
 Empty entry (built by EventsDB).
 EventDBEntry (QJsonValue &data)
 Build from a JSON value.
void deepLink ()
 Resolve the associated maps.
void qmlRegister () const
 Register with QML.

Protected Attributes

QString name = ""
int ind = 0
int byte = 0
int bit = 0
QVector< QString > maps
QVector< MapDBEntry * > toMaps

Friends

class EventsDB
 Owning DB constructs/populates entries.

Detailed Description

One story-event definition: its name and where its flag lives in the save.

QObject-getter style DB entry. Pinpoints the event flag (byte / bit) the save's WorldEvents bitfield stores, and lists the maps it relates to (maps -> toMaps in deepLink). Surfaced lists use the size + invokable ...At() accessor workaround. See db.md.

See also
EventsDB, WorldEvents (the save-side flags).

Definition at line 42 of file eventdbentry.h.

Constructor & Destructor Documentation

◆ EventDBEntry() [1/2]

EventDBEntry::EventDBEntry ( )
protected

Empty entry (built by EventsDB).

Definition at line 38 of file eventdbentry.cpp.

References qmlRegister().

◆ EventDBEntry() [2/2]

EventDBEntry::EventDBEntry ( QJsonValue & data)
protected

Build from a JSON value.

Definition at line 41 of file eventdbentry.cpp.

References bit, ind, maps, name, and qmlRegister().

Member Function Documentation

◆ deepLink()

void EventDBEntry::deepLink ( )
protected

Resolve the associated maps.

Definition at line 54 of file eventdbentry.cpp.

References MapsDB::getIndAt(), MapsDB::inst(), maps, name, and toMaps.

◆ getBit()

int EventDBEntry::getBit ( ) const
See also
getBit property.

Definition at line 122 of file eventdbentry.cpp.

References bit.

◆ getByte()

int EventDBEntry::getByte ( ) const
See also
getByte property.

Definition at line 127 of file eventdbentry.cpp.

References byte.

◆ getInd()

int EventDBEntry::getInd ( ) const
See also
getInd property.

Definition at line 132 of file eventdbentry.cpp.

References ind.

◆ getMapAt()

const QString EventDBEntry::getMapAt ( int ind) const

Associated map name ind (for QML).

Definition at line 114 of file eventdbentry.cpp.

References ind, and maps.

◆ getMaps()

const QVector< QString > EventDBEntry::getMaps ( ) const

Associated map names.

Definition at line 104 of file eventdbentry.cpp.

References maps.

◆ getMapsSize()

int EventDBEntry::getMapsSize ( ) const
See also
getMapsSize property.

Definition at line 109 of file eventdbentry.cpp.

References maps.

◆ getName()

const QString EventDBEntry::getName ( ) const

< Event name.

Internal event index. Byte in the SAV holding the flag. Bit within that byte. Count of associated map names. Count of resolved maps.

See also
getName property.

Definition at line 137 of file eventdbentry.cpp.

References name.

◆ getToMapAt()

const MapDBEntry * EventDBEntry::getToMapAt ( int ind) const

Resolved map ind (for QML).

Definition at line 91 of file eventdbentry.cpp.

References ind, and toMaps.

◆ getToMaps()

const QVector< MapDBEntry * > EventDBEntry::getToMaps ( ) const

Resolved associated maps.

Definition at line 81 of file eventdbentry.cpp.

References toMaps.

◆ getToMapsSize()

int EventDBEntry::getToMapsSize ( ) const
See also
getToMapsSize property.

Definition at line 86 of file eventdbentry.cpp.

References toMaps.

◆ qmlProtect()

void EventDBEntry::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 99 of file eventdbentry.cpp.

References Utility::qmlProtectUtil().

◆ qmlRegister()

void EventDBEntry::qmlRegister ( ) const
protected

Register with QML.

Definition at line 71 of file eventdbentry.cpp.

Referenced by EventDBEntry(), and EventDBEntry().

◆ EventsDB

friend class EventsDB
friend

Owning DB constructs/populates entries.

Definition at line 82 of file eventdbentry.h.

References EventsDB.

Referenced by EventsDB.

Member Data Documentation

◆ bit

int EventDBEntry::bit = 0
protected

Definition at line 78 of file eventdbentry.h.

Referenced by EventDBEntry(), and getBit().

◆ byte

int EventDBEntry::byte = 0
protected

Definition at line 77 of file eventdbentry.h.

Referenced by getByte().

◆ ind

int EventDBEntry::ind = 0
protected

Definition at line 76 of file eventdbentry.h.

Referenced by EventDBEntry(), getInd(), getMapAt(), and getToMapAt().

◆ maps

QVector<QString> EventDBEntry::maps
protected

Definition at line 79 of file eventdbentry.h.

Referenced by deepLink(), EventDBEntry(), getMapAt(), getMaps(), and getMapsSize().

◆ name

QString EventDBEntry::name = ""
protected

Definition at line 75 of file eventdbentry.h.

Referenced by deepLink(), EventDBEntry(), and getName().

◆ toMaps

QVector<MapDBEntry*> EventDBEntry::toMaps
protected

Definition at line 80 of file eventdbentry.h.

Referenced by deepLink(), getToMapAt(), getToMaps(), and getToMapsSize().


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