Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
starterPokemon.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
18#include <QObject>
19#include <QString>
20#include <QVector>
21
22#include <pse-common/types.h>
23#include "./db_autoport.h"
24
25struct PokemonDBEntry;
26class QQmlEngine;
27
38// Hand-curated list of good starter choices.
39// Rules: base evolution (if one exists), non-legendary, feels "startery".
40class DB_AUTOPORT StarterPokemonDB : public QObject
41{
42 Q_OBJECT
43 Q_PROPERTY(int getStoreSize READ getStoreSize CONSTANT)
44
45public:
46 static StarterPokemonDB* inst();
47
48 [[nodiscard]] int getStoreSize() const;
49
50 // First 3 entries are the canonical in-game starters.
51 Q_INVOKABLE PokemonDBEntry* random3Starter() const;
52 Q_INVOKABLE PokemonDBEntry* randomAnyStarter() const;
53
54public slots:
55 void load();
56 void deepLink();
57 void qmlProtect(const QQmlEngine* const engine) const;
58
59private slots:
60 void qmlRegister() const;
61
62private:
63 StarterPokemonDB();
64
65 QVector<QString> store;
66 QVector<PokemonDBEntry*> toPokemon;
67};
PokemonDBEntry * random3Starter() const
A random one of the 3 canonical starters.
static StarterPokemonDB * inst()
< Number of starter choices.
void load()
Load the starter list from JSON.
void deepLink()
Resolve the names to species entries.
int getStoreSize() const
Starter-choice count.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
PokemonDBEntry * randomAnyStarter() const
A random "startery" species.
Project-wide fixed-width integer aliases (var8, var16, ...).
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 species' complete static data – the richest entry in the db layer.
Definition pokemon.h:98