Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
eventpokemondb.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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
// With amazing help of Quicktype!!!
18
// https://app.quicktype.io
19
20
#include <QObject>
21
#include <QVector>
22
23
#include "
./db_autoport.h
"
24
25
// These are Pokemon you get by going to or participating in real-life events
26
// that were held around the world
27
28
struct
EventPokemonDBEntry
;
29
class
QQmlEngine;
30
40
class
DB_AUTOPORT
EventPokemonDB :
public
QObject
41
{
42
Q_OBJECT
43
Q_PROPERTY(
int
getStoreSize
READ
getStoreSize
CONSTANT)
44
45
public
:
46
// Get Instance
47
static
EventPokemonDB*
inst
();
48
49
// Get Properties, includes QML array helpers
50
const
QVector<EventPokemonDBEntry*>
getStore
()
const
;
51
int
getStoreSize
()
const
;
52
53
// QML Methods that can't be a property or slot because they take an argument
54
Q_INVOKABLE
EventPokemonDBEntry
*
getStoreAt
(
const
int
ind)
const
;
55
56
public
slots:
57
// QML accessible methods
58
void
load
();
59
void
deepLink
();
60
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
61
62
private
slots:
63
void
qmlRegister()
const
;
64
65
private
:
66
// Singleton Constructor
67
EventPokemonDB();
68
69
// Store
70
QVector<EventPokemonDBEntry*> store;
71
};
EventPokemonDB::deepLink
void deepLink()
Resolve each entry's species/move links.
Definition
eventpokemondb.cpp:83
EventPokemonDB::getStoreSize
int getStoreSize() const
Event-Pokemon count.
Definition
eventpokemondb.cpp:48
EventPokemonDB::load
void load()
Load event Pokemon from JSON.
Definition
eventpokemondb.cpp:61
EventPokemonDB::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
eventpokemondb.cpp:97
EventPokemonDB::inst
static EventPokemonDB * inst()
< Number of event Pokemon.
Definition
eventpokemondb.cpp:37
EventPokemonDB::getStore
const QVector< EventPokemonDBEntry * > getStore() const
All event Pokemon.
Definition
eventpokemondb.cpp:43
EventPokemonDB::getStoreAt
EventPokemonDBEntry * getStoreAt(const int ind) const
Event Pokemon by store index (for QML).
Definition
eventpokemondb.cpp:53
db_autoport.h
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
DB_AUTOPORT
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
db_autoport.h:37
EventPokemonDBEntry
One real-world event-distribution Pokemon preset.
Definition
eventpokemondbentry.h:37
projects
db
src
pse-db
eventpokemondb.h
Generated by
1.17.0