Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
halloffame.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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
#include <QObject>
18
#include <QVector>
19
#include <QQmlListProperty>
20
#include <
pse-common/types.h
>
21
#include "
../savefile_autoport.h
"
22
23
class
SaveFile
;
24
class
HoFRecord
;
25
26
constexpr
var8
recordsMax
= 50;
27
37
class
SAVEFILE_AUTOPORT
HallOfFame
:
public
QObject
38
{
39
Q_OBJECT
40
41
public
:
42
HallOfFame
(
SaveFile
* saveFile =
nullptr
);
43
virtual
~HallOfFame
();
44
45
void
load
(
SaveFile
* saveFile =
nullptr
);
46
void
save
(
SaveFile
* saveFile);
47
48
// Since Qt has tied my hands in so many ways on fixing the issue of no arrays
49
// but primitive arrays being able to be sent to QML, I'm left with no other
50
// options outside of a custom model to flood classes with a series of methods
51
// for each and every array of any kind that's not primitive
52
Q_INVOKABLE
int
recordCount
();
53
Q_INVOKABLE
int
recordMax
();
54
Q_INVOKABLE
HoFRecord
*
recordAt
(
int
ind);
55
Q_INVOKABLE
void
recordSwap
(
int
from,
int
to);
56
Q_INVOKABLE
void
recordRemove
(
int
ind);
57
Q_INVOKABLE
void
recordNew
();
58
59
signals:
60
void
recordsChanged
();
61
62
public
slots:
63
void
reset
();
64
void
randomize
();
65
66
public
:
67
// All Hall of Fame Records
68
QVector<HoFRecord*>
records
;
69
};
HallOfFame::records
QVector< HoFRecord * > records
Every Hall of Fame record.
Definition
halloffame.h:68
HallOfFame::recordCount
int recordCount()
Number of records.
Definition
halloffame.cpp:42
HallOfFame::save
void save(SaveFile *saveFile)
Flatten the Hall of Fame records to the save.
Definition
halloffame.cpp:105
HallOfFame::randomize
void randomize()
Fill with random records.
Definition
halloffame.cpp:124
HallOfFame::HallOfFame
HallOfFame(SaveFile *saveFile=nullptr)
Definition
halloffame.cpp:31
HallOfFame::recordAt
HoFRecord * recordAt(int ind)
Record ind (GC-protected return).
Definition
halloffame.cpp:52
HallOfFame::load
void load(SaveFile *saveFile=nullptr)
Expand the Hall of Fame records from the save.
Definition
halloffame.cpp:88
HallOfFame::recordsChanged
protected::void recordsChanged()
HallOfFame::reset
void reset()
Clear all records.
Definition
halloffame.cpp:115
HallOfFame::recordNew
void recordNew()
Add a fresh record.
Definition
halloffame.cpp:79
HallOfFame::recordMax
int recordMax()
Capacity (recordsMax).
Definition
halloffame.cpp:47
HallOfFame::recordSwap
void recordSwap(int from, int to)
Reorder records.
Definition
halloffame.cpp:57
HallOfFame::recordRemove
void recordRemove(int ind)
Remove record ind.
Definition
halloffame.cpp:68
HoFRecord
One Hall of Fame record: the team that beat the Elite Four, in order.
Definition
hofrecord.h:37
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
var8
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition
types.h:124
recordsMax
constexpr var8 recordsMax
Maximum Hall of Fame records the save keeps.
Definition
halloffame.h:26
savefile_autoport.h
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
SAVEFILE_AUTOPORT
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
savefile_autoport.h:38
projects
savefile
src
pse-savefile
expanded
halloffame.h
Generated by
1.17.0