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

The maps database – every map and its full layout, keyed by name. More...

#include <mapsdb.h>

Inheritance diagram for MapsDB:
Collaboration diagram for MapsDB:

Public Member Functions

const QVector< MapDBEntry * > getStore () const
 All maps.
const QHash< QString, MapDBEntry * > getInd () const
 Name->map index.
int getStoreSize () const
 Map count.
MapSearch * searchRaw () const
 Raw finder for QML (QML-managed ownership).
QScopedPointer< MapSearch, QScopedPointerDeleteLater > search () const
 C++-owned finder (smart pointer).
MapDBEntry * getStoreAt (const int ind) const
 Map by store index (for QML).
MapDBEntry * getIndAt (const QString val) const
 Map by name key (for QML).
void load ()
 Load maps from JSON.
void index ()
 Build the name->map index.
void deepLink ()
 Resolve every map's warps/sprites/connections/etc.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static MapsDB * inst ()
 < Number of maps.

Detailed Description

The maps database – every map and its full layout, keyed by name.

The largest entry family in the project: each MapDBEntry (in entries/) carries a map's size, connections, warps, signs, sprites, tileset, music, and wild encounters. MapsDB is otherwise a standard DB-singleton with a name index and a deepLink() pass, plus a MapSearch finder (like FontsDB) – search / searchRaw differ only in ownership (C++ smart-pointer vs QML-managed raw).

See also
MapDBEntry (and the MapDBEntry* family), MapSearch, Area (the save-side map).

Definition at line 40 of file mapsdb.h.

Member Function Documentation

◆ deepLink()

void MapsDB::deepLink ( )

Resolve every map's warps/sprites/connections/etc.

Definition at line 98 of file mapsdb.cpp.

◆ getInd()

const QHash< QString, MapDBEntry * > MapsDB::getInd ( ) const

◆ getIndAt()

◆ getStore()

const QVector< MapDBEntry * > MapsDB::getStore ( ) const

All maps.

Definition at line 41 of file mapsdb.cpp.

◆ getStoreAt()

MapDBEntry * MapsDB::getStoreAt ( const int ind) const

Map by store index (for QML).

Definition at line 147 of file mapsdb.cpp.

◆ getStoreSize()

int MapsDB::getStoreSize ( ) const

Map count.

Definition at line 51 of file mapsdb.cpp.

◆ index()

void MapsDB::index ( )

Build the name->map index.

Definition at line 78 of file mapsdb.cpp.

◆ inst()

◆ load()

void MapsDB::load ( )

Load maps from JSON.

Definition at line 56 of file mapsdb.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 112 of file mapsdb.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().

◆ search()

QScopedPointer< MapSearch, QScopedPointerDeleteLater > MapsDB::search ( ) const

C++-owned finder (smart pointer).

Definition at line 141 of file mapsdb.cpp.

Referenced by Area::randomize(), AreaWarps::randomize(), WarpData::randomize(), and AreaWarps::setTo().

◆ searchRaw()

MapSearch * MapsDB::searchRaw ( ) const

Raw finder for QML (QML-managed ownership).

Definition at line 136 of file mapsdb.cpp.


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