|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
One edge connection of a map (the seam to a neighbouring map). More...
#include <mapdbentryconnect.h>
Public Types | |
| enum | ConnectDir { NORTH , SOUTH , EAST , WEST } |
| The four connectable edges. More... | |
Public Member Functions | |
| int | stripLocation () const |
| int | mapPos () const |
| int | stripSize () const |
| int | yAlign () const |
| int | xAlign () const |
| int | window () const |
| ConnectDir | getDir () const |
| const QString | getMap () const |
| int | getStripMove () const |
| int | getStripOffset () const |
| bool | getFlag () const |
| MapDBEntry * | getToMap () const |
| MapDBEntry * | getFromMap () const |
| MapDBEntry * | getParent () const |
| void | qmlProtect (const QQmlEngine *const engine) const |
| Pin to C++ ownership. | |
Static Public Attributes | |
| static const constexpr int | worldMapPtr = 0xC6E8 |
| < Strip source pointer. | |
Protected Member Functions | |
| MapDBEntryConnect () | |
| Empty entry. | |
| MapDBEntryConnect (const ConnectDir dir, MapDBEntry *const fromMap, const QJsonValue &data) | |
Build a dir connection on fromMap from JSON. | |
| void | deepLink () |
| Resolve the connected map. | |
| void | qmlRegister () const |
| Register with QML. | |
Protected Attributes | |
| ConnectDir | dir = ConnectDir::NORTH |
| Edge direction. | |
| QString | map = "" |
| Connected map name. | |
| int | stripMove = 0 |
| Strip centering. | |
| int | stripOffset = 0 |
| Strip position. | |
| bool | flag = false |
| +3 offset flag (purpose unknown; see note). | |
| MapDBEntry * | toMap = nullptr |
| Resolved connected map (deepLink). | |
| MapDBEntry * | fromMap = nullptr |
| Owning map. | |
| MapDBEntry * | parent = nullptr |
Friends | |
| class | MapDBEntry |
One edge connection of a map (the seam to a neighbouring map).
The DB counterpart to the save's MapConnData – and, per the forewarning above, the single most complicated data structure in Gen 1. The pointer/offset fields (stripLocation, mapPos, stripSize, yAlign / xAlign, window) are the raw connection math; their AKA names are noted inline. The ConnectDir says which edge. deepLink() resolves toMap. See db.md.
Definition at line 60 of file mapdbentryconnect.h.
The four connectable edges.
| Enumerator | |
|---|---|
| NORTH | |
| SOUTH | |
| EAST | |
| WEST | |
Definition at line 83 of file mapdbentryconnect.h.
|
protected |
|
protected |
Build a dir connection on fromMap from JSON.
Definition at line 33 of file mapdbentryconnect.cpp.
References dir, flag, fromMap, map, MapDBEntry, parent, qmlRegister(), stripMove, and stripOffset.
|
protected |
Resolve the connected map.
Definition at line 52 of file mapdbentryconnect.cpp.
References MapsDB::getInd(), MapsDB::inst(), map, and toMap.
| MapDBEntryConnect::ConnectDir MapDBEntryConnect::getDir | ( | ) | const |
| bool MapDBEntryConnect::getFlag | ( | ) | const |
| MapDBEntry * MapDBEntryConnect::getFromMap | ( | ) | const |
Definition at line 83 of file mapdbentryconnect.cpp.
References fromMap, and MapDBEntry.
| const QString MapDBEntryConnect::getMap | ( | ) | const |
| MapDBEntry * MapDBEntryConnect::getParent | ( | ) | const |
Definition at line 73 of file mapdbentryconnect.cpp.
References MapDBEntry, and parent.
| int MapDBEntryConnect::getStripMove | ( | ) | const |
Definition at line 103 of file mapdbentryconnect.cpp.
References stripMove.
| int MapDBEntryConnect::getStripOffset | ( | ) | const |
Definition at line 98 of file mapdbentryconnect.cpp.
References stripOffset.
| MapDBEntry * MapDBEntryConnect::getToMap | ( | ) | const |
Definition at line 88 of file mapdbentryconnect.cpp.
References MapDBEntry, and toMap.
Referenced by MapConnData::loadFromData().
| int MapDBEntryConnect::mapPos | ( | ) | const |
Definition at line 151 of file mapdbentryconnect.cpp.
References dir, fromMap, NORTH, SOUTH, stripMove, WEST, and worldMapPtr.
Referenced by MapConnData::loadFromData().
| void MapDBEntryConnect::qmlProtect | ( | const QQmlEngine *const | engine | ) | const |
Pin to C++ ownership.
Definition at line 78 of file mapdbentryconnect.cpp.
References Utility::qmlProtectUtil().
|
protected |
Register with QML.
Definition at line 62 of file mapdbentryconnect.cpp.
Referenced by MapDBEntryConnect(), and MapDBEntryConnect().
| int MapDBEntryConnect::stripLocation | ( | ) | const |
Definition at line 118 of file mapdbentryconnect.cpp.
References dir, NORTH, SOUTH, stripOffset, toMap, and WEST.
Referenced by MapConnData::loadFromData().
| int MapDBEntryConnect::stripSize | ( | ) | const |
Definition at line 178 of file mapdbentryconnect.cpp.
References dir, flag, fromMap, NORTH, SOUTH, stripMove, stripOffset, toMap, and WEST.
Referenced by MapConnData::loadFromData().
| int MapDBEntryConnect::window | ( | ) | const |
Definition at line 288 of file mapdbentryconnect.cpp.
References dir, NORTH, SOUTH, toMap, WEST, and worldMapPtr.
Referenced by MapConnData::loadFromData().
| int MapDBEntryConnect::xAlign | ( | ) | const |
Definition at line 257 of file mapdbentryconnect.cpp.
References dir, NORTH, SOUTH, stripMove, stripOffset, toMap, and WEST.
Referenced by MapConnData::loadFromData().
| int MapDBEntryConnect::yAlign | ( | ) | const |
Definition at line 232 of file mapdbentryconnect.cpp.
References dir, NORTH, SOUTH, stripMove, stripOffset, toMap, and WEST.
Referenced by MapConnData::loadFromData().
|
friend |
Definition at line 161 of file mapdbentryconnect.h.
References MapDBEntry.
Referenced by getFromMap(), getParent(), getToMap(), MapDBEntry, and MapDBEntryConnect().
|
protected |
Edge direction.
Definition at line 139 of file mapdbentryconnect.h.
Referenced by getDir(), MapDBEntryConnect(), mapPos(), stripLocation(), stripSize(), window(), xAlign(), and yAlign().
|
protected |
+3 offset flag (purpose unknown; see note).
Definition at line 152 of file mapdbentryconnect.h.
Referenced by getFlag(), MapDBEntryConnect(), and stripSize().
|
protected |
Owning map.
Definition at line 158 of file mapdbentryconnect.h.
Referenced by getFromMap(), MapDBEntryConnect(), mapPos(), and stripSize().
|
protected |
Connected map name.
Definition at line 142 of file mapdbentryconnect.h.
Referenced by deepLink(), getMap(), and MapDBEntryConnect().
|
protected |
Definition at line 159 of file mapdbentryconnect.h.
Referenced by getParent(), and MapDBEntryConnect().
|
protected |
Strip centering.
Definition at line 145 of file mapdbentryconnect.h.
Referenced by getStripMove(), MapDBEntryConnect(), mapPos(), stripSize(), xAlign(), and yAlign().
|
protected |
Strip position.
Definition at line 148 of file mapdbentryconnect.h.
Referenced by getStripOffset(), MapDBEntryConnect(), stripLocation(), stripSize(), xAlign(), and yAlign().
|
protected |
Resolved connected map (deepLink).
Definition at line 155 of file mapdbentryconnect.h.
Referenced by deepLink(), getToMap(), stripLocation(), stripSize(), window(), xAlign(), and yAlign().
|
staticconstexpr |
< Strip source pointer.
Strip destination pointer. Connection size (blocks). Player Y offset (steps). Player X offset (steps). View/UL-corner pointer. Which edge this connects. Connected map name. Strip centering. Strip position. The +3 offset flag (see field note). Resolved connected map. Map owning this connection. Same as fromMap (alias). Fixed overworld-map RAM pointer (see note).
Definition at line 80 of file mapdbentryconnect.h.
Referenced by AreaMap::coordsToPtr(), mapPos(), and window().