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

The story-events database – metadata for the 508 event flags, keyed by name. More...

#include <eventsdb.h>

Inheritance diagram for EventsDB:
Collaboration diagram for EventsDB:

Public Member Functions

const QVector< EventDBEntry * > getStore () const
 All event definitions.
const QHash< QString, EventDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Event count.
EventDBEntrygetStoreAt (const int ind) const
 Event by store index (for QML).
EventDBEntrygetIndAt (const QString val) const
 Event by name key (for QML).
void load ()
 Load events from JSON.
void index ()
 Build the name->entry index.
void deepLink ()
 Resolve each event's cross-DB links.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static EventsDBinst ()
 < Number of event definitions.

Detailed Description

The story-events database – metadata for the 508 event flags, keyed by name.

The DB-side companion to the save's WorldEvents bitfield: it names and describes each known event flag. Standard DB-singleton with a name index and deepLink(). See CreditsDB / db.md; the entry type is in entries/eventdbentry.h.

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

Definition at line 40 of file eventsdb.h.

Member Function Documentation

◆ deepLink()

void EventsDB::deepLink ( )

Resolve each event's cross-DB links.

Definition at line 107 of file eventsdb.cpp.

◆ getInd()

const QHash< QString, EventDBEntry * > EventsDB::getInd ( ) const

Name->entry index.

Definition at line 46 of file eventsdb.cpp.

◆ getIndAt()

EventDBEntry * EventsDB::getIndAt ( const QString val) const

Event by name key (for QML).

Definition at line 64 of file eventsdb.cpp.

◆ getStore()

const QVector< EventDBEntry * > EventsDB::getStore ( ) const

All event definitions.

Definition at line 41 of file eventsdb.cpp.

Referenced by WorldEvents::load(), and WorldEvents::save().

◆ getStoreAt()

EventDBEntry * EventsDB::getStoreAt ( const int ind) const

Event by store index (for QML).

Definition at line 56 of file eventsdb.cpp.

◆ getStoreSize()

int EventsDB::getStoreSize ( ) const

Event count.

Definition at line 51 of file eventsdb.cpp.

Referenced by WorldEvents::load(), and WorldEvents::save().

◆ index()

void EventsDB::index ( )

Build the name->entry index.

Definition at line 91 of file eventsdb.cpp.

◆ inst()

EventsDB * EventsDB::inst ( )
static

< Number of event definitions.

The process-wide EventsDB singleton.

Definition at line 35 of file eventsdb.cpp.

Referenced by DB::events(), WorldEvents::load(), DB::qmlProtect(), and WorldEvents::save().

◆ load()

void EventsDB::load ( )

Load events from JSON.

Definition at line 69 of file eventsdb.cpp.

References GameData::inst(), and GameData::json().

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 121 of file eventsdb.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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