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

The fly-destinations database – where Fly can take you, keyed by name. More...

#include <flydb.h>

Inheritance diagram for FlyDB:
Collaboration diagram for FlyDB:

Public Member Functions

const QVector< FlyDBEntry * > getStore () const
 All fly destinations.
const QHash< QString, FlyDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Destination count.
FlyDBEntrygetStoreAt (const int ind) const
 Destination by store index (for QML).
FlyDBEntrygetIndAt (const QString val) const
 Destination by name key (for QML).
void load ()
 Load destinations from JSON.
void index ()
 Build the name->entry index.
void deepLink ()
 Resolve each destination's map link.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.
 FlyDB ()
 (Public here, but obtain the singleton via inst().)

Static Public Member Functions

static FlyDBinst ()
 < Number of fly destinations.

Public Attributes

QVector< FlyDBEntry * > store
 The loaded destinations.
QHash< QString, FlyDBEntry * > ind
 Name->entry lookup.

Detailed Description

The fly-destinations database – where Fly can take you, keyed by name.

Standard DB-singleton with a name index and a deepLink() pass (resolving each destination to its map). See CreditsDB / db.md for the shared pattern; the entry type lives in entries/flydbentry.h.

See also
FlyDBEntry, DB.

Definition at line 37 of file flydb.h.

Constructor & Destructor Documentation

◆ FlyDB()

FlyDB::FlyDB ( )

(Public here, but obtain the singleton via inst().)

Definition at line 139 of file flydb.cpp.

References load().

Referenced by inst().

Member Function Documentation

◆ deepLink()

void FlyDB::deepLink ( )

Resolve each destination's map link.

Definition at line 108 of file flydb.cpp.

References store.

◆ getInd()

const QHash< QString, FlyDBEntry * > FlyDB::getInd ( ) const

Name->entry index.

Definition at line 47 of file flydb.cpp.

References ind.

◆ getIndAt()

FlyDBEntry * FlyDB::getIndAt ( const QString val) const

Destination by name key (for QML).

Definition at line 65 of file flydb.cpp.

References ind.

◆ getStore()

const QVector< FlyDBEntry * > FlyDB::getStore ( ) const

All fly destinations.

Definition at line 42 of file flydb.cpp.

References store.

◆ getStoreAt()

FlyDBEntry * FlyDB::getStoreAt ( const int ind) const

Destination by store index (for QML).

Definition at line 57 of file flydb.cpp.

References ind, and store.

◆ getStoreSize()

int FlyDB::getStoreSize ( ) const

Destination count.

Definition at line 52 of file flydb.cpp.

References store.

◆ index()

void FlyDB::index ( )

Build the name->entry index.

Definition at line 92 of file flydb.cpp.

References ind, and store.

◆ inst()

FlyDB * FlyDB::inst ( )
static

< Number of fly destinations.

The process-wide FlyDB singleton.

Definition at line 36 of file flydb.cpp.

References FlyDB().

Referenced by DB::fly(), and DB::qmlProtect().

◆ load()

void FlyDB::load ( )

Load destinations from JSON.

Definition at line 70 of file flydb.cpp.

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

Referenced by FlyDB().

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 122 of file flydb.cpp.

References Utility::qmlProtectUtil(), and store.

Referenced by DB::qmlProtect().

Member Data Documentation

◆ ind

QHash<QString, FlyDBEntry*> FlyDB::ind

Name->entry lookup.

Definition at line 68 of file flydb.h.

Referenced by getInd(), getIndAt(), getStoreAt(), and index().

◆ store

QVector<FlyDBEntry*> FlyDB::store

The loaded destinations.

Definition at line 67 of file flydb.h.

Referenced by deepLink(), getStore(), getStoreAt(), getStoreSize(), index(), load(), and qmlProtect().


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