Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
tmHm.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 ItemDBEntry;
26struct MoveDBEntry;
27class QQmlEngine;
28
39// All TMs and HMs. Internally HMs are TMs starting at TM 51.
40class DB_AUTOPORT TmHmsDB : public QObject
41{
42 Q_OBJECT
43 Q_PROPERTY(int getStoreSize READ getStoreSize CONSTANT)
44
45public:
46 static TmHmsDB* inst();
47
48 [[nodiscard]] const QVector<QString> getStore() const;
49 [[nodiscard]] int getStoreSize() const;
50 [[nodiscard]] const QVector<ItemDBEntry*>& getTmHmItems() const;
51 [[nodiscard]] const QVector<MoveDBEntry*>& getTmHmMoves() const;
52
53public slots:
54 void load();
55 void deepLink();
56 void qmlProtect(const QQmlEngine* const engine) const;
57
58private slots:
59 void qmlRegister() const;
60
61private:
62 TmHmsDB();
63
64 QVector<QString> store;
65 QVector<ItemDBEntry*> toTmHmItem;
66 QVector<MoveDBEntry*> toTmHmMove;
67};
const QVector< ItemDBEntry * > & getTmHmItems() const
The item for each TM/HM (parallel to store).
Definition tmHm.cpp:43
const QVector< QString > getStore() const
Move names in TM/HM order.
Definition tmHm.cpp:41
void load()
Load the TM/HM list from JSON.
Definition tmHm.cpp:46
static TmHmsDB * inst()
< Number of TMs+HMs.
Definition tmHm.cpp:35
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition tmHm.cpp:75
void deepLink()
Resolve the parallel item/move vectors.
Definition tmHm.cpp:56
int getStoreSize() const
TM+HM count.
Definition tmHm.cpp:42
const QVector< MoveDBEntry * > & getTmHmMoves() const
The move for each TM/HM (parallel to store).
Definition tmHm.cpp:44
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 item's static data: name/flags, pricing, and where it's used.
Definition itemdbentry.h:46
One move's static data (type, power, accuracy, PP, TM/HM), with links.
Definition moves.h:46