Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapdbentrysign.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 MapDBEntry;
22class QQmlEngine;
23class MapDBEntry;
24
32struct DB_AUTOPORT MapDBEntrySign : public QObject
33{
34 Q_OBJECT
35 Q_PROPERTY(int getX READ getX CONSTANT)
36 Q_PROPERTY(int getY READ getY CONSTANT)
37 Q_PROPERTY(int getTextID READ getTextID CONSTANT)
38 Q_PROPERTY(MapDBEntry* getParent READ getParent CONSTANT)
39
40public:
41 int getX() const;
42 int getY() const;
43 int getTextID() const;
44 MapDBEntry* getParent() const;
45
46public slots:
47 void qmlProtect(const QQmlEngine* const engine) const;
48
49protected:
51 MapDBEntrySign(const QJsonValue& data,
52 MapDBEntry* const parent);
53 void qmlRegister() const;
54
55 // X & Y location on Map
56 int x = 0;
57 int y = 0;
58
59 // Which text id to display when interacting with sign
60 int textID = 0;
61
62 MapDBEntry* parent = nullptr;
63
64 friend class MapDBEntry;
65};
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 getTextID() const
friend class MapDBEntry
int y
Sign tile Y.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
int textID
Text id shown when read.
int x
Sign tile X.
MapDBEntry * parent
Owning map.
MapDBEntry * getParent() const
void qmlRegister() const
Register with QML.
int getX() const
< Sign tile X.
MapDBEntrySign()
Empty entry.
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56