Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapdbentrywarpout.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Twilight
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15*/
16#pragma once
17#include <QObject>
18#include <QJsonValue>
19#include "../db_autoport.h"
20
21class QQmlEngine;
22class MapDBEntry;
23class MapsDB;
25
26// List of Warps on Map that warp out to a different map
27// They can only warp to a "warp-in" point
37struct DB_AUTOPORT MapDBEntryWarpOut : public QObject {
38 Q_OBJECT
39 Q_PROPERTY(int getX READ getX CONSTANT)
40 Q_PROPERTY(int getY READ getY CONSTANT)
41 Q_PROPERTY(int getWarp READ getWarp CONSTANT)
42 Q_PROPERTY(QString getMap READ getMap CONSTANT)
43 Q_PROPERTY(bool getGlitch READ getGlitch CONSTANT)
44 Q_PROPERTY(MapDBEntry* getToMap READ getToMap CONSTANT)
45 Q_PROPERTY(MapDBEntry* getParent READ getParent CONSTANT)
46 Q_PROPERTY(MapDBEntryWarpIn* getToWarp READ getToWarp CONSTANT)
47
48public:
49 int getX() const;
50 int getY() const;
51 int getWarp() const;
52 const QString getMap() const;
53 bool getGlitch() const;
54 MapDBEntry* getToMap() const;
55 MapDBEntry* getParent() const;
57
58public slots:
59 void qmlProtect(const QQmlEngine* const engine) const;
60
61protected:
63 MapDBEntryWarpOut(const QJsonValue& data, MapDBEntry* const parent);
64 void deepLink();
65 void qmlRegister() const;
66
67 // X & Y location on Map
68 int x = 0;
69 int y = 0;
70
71 // Which pre-defined warp-in to warp to
72 int warp = 0;
73
74 // Which map to warp to
75 QString map = "";
76
77 // Is this warp-out not intended to be used
78 bool glitch = false;
79
80 // Go to map
81 MapDBEntry* toMap = nullptr;
82 MapDBEntry* parent = nullptr;
83
84 // Go to warp spot on destination map
86
87 friend class MapDBEntry;
88 friend class MapsDB;
89 friend class MapDBEntryWarpIn;
90};
The maps database – every map and its full layout, keyed by name.
Definition mapsdb.h:41
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition db_autoport.h:37
A warp-in point: a destination spot other maps' warp-outs land on.
MapDBEntryWarpOut()
Empty entry.
MapDBEntry * toMap
Resolved destination map (deepLink).
MapDBEntryWarpIn * getToWarp() const
void deepLink()
Resolve the destination map + warp-in.
MapDBEntryWarpIn * toWarp
Resolved destination warp-in (deepLink).
friend class MapDBEntry
int getX() const
< Warp-out tile X.
friend class MapDBEntryWarpIn
void qmlRegister() const
Register with QML.
const QString getMap() const
int x
Warp-out tile X.
int y
Warp-out tile Y.
MapDBEntry * getParent() const
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
MapDBEntry * parent
Owning map.
QString map
Destination map name.
bool glitch
Glitch/unintended warp.
MapDBEntry * getToMap() const
int warp
Target warp-in index.
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56