Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapdbentrywarpin.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
35struct DB_AUTOPORT MapDBEntryWarpIn : public QObject {
36 Q_OBJECT
37 Q_PROPERTY(int getX READ getX CONSTANT)
38 Q_PROPERTY(int getY READ getY CONSTANT)
39 Q_PROPERTY(int getToConnectingWarpsSize READ getToConnectingWarpsSize CONSTANT)
40 Q_PROPERTY(MapDBEntry* getParent READ getParent CONSTANT)
41
42public:
43 int getX() const;
44 int getY() const;
45
46 const QVector<MapDBEntryWarpOut*> getToConnectingWarps() const;
47 int getToConnectingWarpsSize() const;
48 Q_INVOKABLE MapDBEntryWarpOut* getToConnectingWarpsAt(const int ind) const;
49
50 MapDBEntry* getParent() const;
51
52public slots:
53 void qmlProtect(const QQmlEngine* const engine) const;
54
55protected:
57 MapDBEntryWarpIn(const QJsonValue& data, MapDBEntry* const parent);
58 void qmlRegister() const;
59
60 // X & Y location on Map
61 int x = 0;
62 int y = 0;
63
64 QVector<MapDBEntryWarpOut*> toConnectingWarps;
65 MapDBEntry* parent = nullptr;
66
67 friend class MapDBEntry;
68 friend class MapsDB;
69 friend class MapDBEntryWarpOut;
70};
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
int getX() const
< Warp-in tile X.
int getToConnectingWarpsSize() const
void qmlRegister() const
Register with QML.
int y
Warp-in tile Y.
friend class MapDBEntry
QVector< MapDBEntryWarpOut * > toConnectingWarps
Warp-outs arriving here (filled by warp-out deepLink).
MapDBEntryWarpIn()
Empty entry.
friend class MapsDB
MapDBEntry * parent
Owning map.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
friend class MapDBEntryWarpOut
MapDBEntryWarpOut * getToConnectingWarpsAt(const int ind) const
Connecting warp ind (for QML).
MapDBEntry * getParent() const
const QVector< MapDBEntryWarpOut * > getToConnectingWarps() const
Warp-outs that land here.
int x
Warp-in tile X.
A warp-out point: a tile that warps the player to another map.
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56