Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
mapdbentrysign.cpp
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
21
22
#include <QQmlEngine>
23
#include <
pse-common/utility.h
>
24
#include "
mapdbentrysign.h
"
25
26
MapDBEntrySign::MapDBEntrySign
() {
27
qmlRegister
();
28
}
29
30
MapDBEntry
*
MapDBEntrySign::getParent
()
const
31
{
32
return
parent
;
33
}
34
35
void
MapDBEntrySign::qmlProtect
(
const
QQmlEngine*
const
engine)
const
36
{
37
Utility::qmlProtectUtil
(
this
, engine);
38
}
39
40
int
MapDBEntrySign::getTextID
()
const
41
{
42
return
textID
;
43
}
44
45
int
MapDBEntrySign::getY
()
const
46
{
47
return
y
;
48
}
49
50
int
MapDBEntrySign::getX
()
const
51
{
52
return
x
;
53
}
54
MapDBEntrySign::MapDBEntrySign
(
const
QJsonValue& data,
MapDBEntry
*
const
parent
) :
55
parent
(
parent
)
56
{
57
qmlRegister
();
58
x
= data[
"x"
].toDouble();
59
y
= data[
"y"
].toDouble();
60
textID
= data[
"text"
].toDouble();
61
}
62
63
void
MapDBEntrySign::qmlRegister
()
const
64
{
65
static
bool
once =
false
;
66
if
(once)
67
return
;
68
69
qmlRegisterUncreatableType<MapDBEntrySign>(
70
"PSE.DB.MapDBEntrySign"
, 1, 0,
"MapDBEntrySign"
,
"Can't instantiate in QML"
);
71
once =
true
;
72
}
Utility::qmlProtectUtil
static void qmlProtectUtil(const QObject *const obj, const QQmlEngine *const engine)
Pin obj to C++ ownership so the QML engine never garbage-collects it.
Definition
utility.cpp:63
mapdbentrysign.h
MapDBEntrySign::getY
int getY() const
Definition
mapdbentrysign.cpp:45
MapDBEntrySign::getTextID
int getTextID() const
Definition
mapdbentrysign.cpp:40
MapDBEntrySign::MapDBEntry
friend class MapDBEntry
Definition
mapdbentrysign.h:64
MapDBEntrySign::y
int y
Sign tile Y.
Definition
mapdbentrysign.h:57
MapDBEntrySign::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
mapdbentrysign.cpp:35
MapDBEntrySign::textID
int textID
Text id shown when read.
Definition
mapdbentrysign.h:60
MapDBEntrySign::x
int x
Sign tile X.
Definition
mapdbentrysign.h:56
MapDBEntrySign::parent
MapDBEntry * parent
Owning map.
Definition
mapdbentrysign.h:62
MapDBEntrySign::getParent
MapDBEntry * getParent() const
Definition
mapdbentrysign.cpp:30
MapDBEntrySign::qmlRegister
void qmlRegister() const
Register with QML.
Definition
mapdbentrysign.cpp:63
MapDBEntrySign::getX
int getX() const
< Sign tile X.
Definition
mapdbentrysign.cpp:50
MapDBEntrySign::MapDBEntrySign
MapDBEntrySign()
Empty entry.
Definition
mapdbentrysign.cpp:26
utility.h
projects
db
src
pse-db
entries
mapdbentrysign.cpp
Generated by
1.17.0