Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
examples.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
22
23
#include <QQmlEngine>
24
#include <
pse-common/utility.h
>
25
#include "
examples.h
"
26
27
#include "
./entries/examplesplayer.h
"
28
#include "
./entries/examplesrival.h
"
29
#include "
./entries/examplespokemon.h
"
30
31
Examples*
Examples::inst
()
32
{
33
static
Examples* _inst =
new
Examples;
34
return
_inst;
35
}
36
37
ExamplesPlayer
*
Examples::player
()
const
38
{
39
return
ExamplesPlayer::inst
();
40
}
41
42
ExamplesRival
*
Examples::rival
()
const
43
{
44
return
ExamplesRival::inst
();
45
}
46
47
ExamplesPokemon
*
Examples::pokemon
()
const
48
{
49
return
ExamplesPokemon::inst
();
50
}
51
52
void
Examples::qmlProtect
(
const
QQmlEngine*
const
engine)
const
53
{
54
Utility::qmlProtectUtil
(
this
, engine);
55
56
ExamplesPlayer::inst
()->
qmlProtect
(engine);
57
ExamplesRival::inst
()->
qmlProtect
(engine);
58
ExamplesPokemon::inst
()->
qmlProtect
(engine);
59
}
60
61
void
Examples::qmlRegister()
const
62
{
63
static
bool
once =
false
;
64
if
(once)
65
return
;
66
67
qmlRegisterUncreatableType<Examples>(
"PSE.DB.Examples"
, 1, 0,
"Examples"
,
"Can't instantiate in QML"
);
68
once =
true
;
69
}
70
71
Examples::Examples()
72
{
73
qmlRegister();
74
75
ExamplesPlayer::inst
();
76
ExamplesRival::inst
();
77
ExamplesPokemon::inst
();
78
}
AbstractRandomString::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
abstractrandomstring.cpp:49
ExamplesPlayer
Example player-value source (an AbstractRandomString of presets).
Definition
examplesplayer.h:34
ExamplesPlayer::inst
static ExamplesPlayer * inst()
The process-wide ExamplesPlayer singleton.
Definition
examplesplayer.cpp:48
ExamplesPokemon
Example Pokemon-value source (an AbstractRandomString of presets).
Definition
examplespokemon.h:34
ExamplesPokemon::inst
static ExamplesPokemon * inst()
The process-wide ExamplesPokemon singleton.
Definition
examplespokemon.cpp:48
ExamplesRival
Example rival-value source (an AbstractRandomString of presets).
Definition
examplesrival.h:34
ExamplesRival::inst
static ExamplesRival * inst()
The process-wide ExamplesRival singleton.
Definition
examplesrival.cpp:48
Examples::rival
ExamplesRival * rival() const
The example-rival source (backs rival).
Definition
examples.cpp:42
Examples::pokemon
ExamplesPokemon * pokemon() const
The example-Pokemon source (backs pokemon).
Definition
examples.cpp:47
Examples::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
examples.cpp:52
Examples::player
ExamplesPlayer * player() const
The example-player source (backs player).
Definition
examples.cpp:37
Examples::inst
static Examples * inst()
< Example player source.
Definition
examples.cpp:31
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
examples.h
examplesplayer.h
examplespokemon.h
examplesrival.h
utility.h
projects
db
src
pse-db
examples.cpp
Generated by
1.17.0