Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
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
25
struct
PokemonDBEntry
;
26
class
QQmlEngine;
27
38
// Hand-curated list of good starter choices.
39
// Rules: base evolution (if one exists), non-legendary, feels "startery".
40
class
DB_AUTOPORT
StarterPokemonDB :
public
QObject
41
{
42
Q_OBJECT
43
Q_PROPERTY(
int
getStoreSize
READ
getStoreSize
CONSTANT)
44
45
public
:
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
54
public
slots:
55
void
load
();
56
void
deepLink
();
57
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
58
59
private
slots:
60
void
qmlRegister()
const
;
61
62
private
:
63
StarterPokemonDB();
64
65
QVector<QString> store;
66
QVector<PokemonDBEntry*> toPokemon;
67
};
StarterPokemonDB::random3Starter
PokemonDBEntry * random3Starter() const
A random one of the 3 canonical starters.
Definition
starterPokemon.cpp:43
StarterPokemonDB::inst
static StarterPokemonDB * inst()
< Number of starter choices.
Definition
starterPokemon.cpp:35
StarterPokemonDB::load
void load()
Load the starter list from JSON.
Definition
starterPokemon.cpp:55
StarterPokemonDB::deepLink
void deepLink()
Resolve the names to species entries.
Definition
starterPokemon.cpp:65
StarterPokemonDB::getStoreSize
int getStoreSize() const
Starter-choice count.
Definition
starterPokemon.cpp:41
StarterPokemonDB::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
starterPokemon.cpp:79
StarterPokemonDB::randomAnyStarter
PokemonDBEntry * randomAnyStarter() const
A random "startery" species.
Definition
starterPokemon.cpp:49
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
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
PokemonDBEntry
One species' complete static data – the richest entry in the db layer.
Definition
pokemon.h:98
projects
db
src
pse-db
starterPokemon.h
Generated by
1.17.0