Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
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
29class QQmlEngine;
30
40class DB_AUTOPORT EventPokemonDB : public QObject
41{
42 Q_OBJECT
43 Q_PROPERTY(int getStoreSize READ getStoreSize CONSTANT)
44
45public:
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
56public slots:
57 // QML accessible methods
58 void load();
59 void deepLink();
60 void qmlProtect(const QQmlEngine* const engine) const;
61
62private slots:
63 void qmlRegister() const;
64
65private:
66 // Singleton Constructor
67 EventPokemonDB();
68
69 // Store
70 QVector<EventPokemonDBEntry*> store;
71};
void deepLink()
Resolve each entry's species/move links.
int getStoreSize() const
Event-Pokemon count.
void load()
Load event Pokemon from JSON.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
static EventPokemonDB * inst()
< Number of event Pokemon.
const QVector< EventPokemonDBEntry * > getStore() const
All event Pokemon.
EventPokemonDBEntry * getStoreAt(const int ind) const
Event Pokemon by store index (for QML).
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
One real-world event-distribution Pokemon preset.