Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
hiddenitemdbentry.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 <QString>
19#include <QJsonValue>
20#include "../db_autoport.h"
21
22struct MapDBEntry;
24class QQmlEngine;
25
26
35struct DB_AUTOPORT HiddenItemDBEntry : public QObject {
36 Q_OBJECT
37 Q_PROPERTY(QString getMap READ getMap CONSTANT)
38 Q_PROPERTY(int getX READ getX CONSTANT)
39 Q_PROPERTY(int getY READ getY CONSTANT)
40 Q_PROPERTY(MapDBEntry* getToMap READ getToMap CONSTANT)
41
42public:
43 QString getMap() const;
44 int getX() const;
45 int getY() const;
46 MapDBEntry* getToMap() const;
47
48public slots:
49 void qmlProtect(const QQmlEngine* const engine) const;
50
51protected:
53 HiddenItemDBEntry(const QJsonValue& data);
54 void deepLink();
55 void qmlRegister() const;
56
57 QString map = "";
58 int x = 0;
59 int y = 0;
60 MapDBEntry* toMap = nullptr;
61
62 friend class AbstractHiddenItemDB;
63};
Shared base for the two hidden-pickup databases (items and coins).
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
void qmlRegister() const
Register with QML.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
MapDBEntry * toMap
Resolved map (deepLink).
QString getMap() const
< Map name the pickup is on.
void deepLink()
Resolve the map link.
QString map
Backing field (read via getMap()).
MapDBEntry * getToMap() const
int x
Backing field (read via getX()).
int y
Backing field (read via getY()).
friend class AbstractHiddenItemDB
Owning DB constructs/populates entries.
HiddenItemDBEntry()
Empty entry (built by the DB).
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56