Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
hofrecord.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 <
pse-common/types.h
>
20
#include "
../../savefile_autoport.h
"
21
22
class
SaveFile
;
23
class
HoFPokemon
;
24
25
constexpr
var8
maxPokemon
= 6;
26
36
class
SAVEFILE_AUTOPORT
HoFRecord
:
public
QObject
37
{
38
Q_OBJECT
39
40
public
:
42
HoFRecord
(
SaveFile
* saveFile =
nullptr
,
var8
ind = 0);
43
virtual
~HoFRecord
();
44
45
void
load
(
SaveFile
* saveFile =
nullptr
,
var8
ind = 0);
46
void
save
(
SaveFile
* saveFile,
var8
ind);
47
48
Q_INVOKABLE
int
pokemonCount
();
49
Q_INVOKABLE
int
pokemonMax
();
50
Q_INVOKABLE
HoFPokemon
*
pokemonAt
(
int
ind);
51
Q_INVOKABLE
void
pokemonSwap
(
int
from,
int
to);
52
Q_INVOKABLE
void
pokemonRemove
(
int
ind);
53
Q_INVOKABLE
void
pokemonNew
();
54
55
signals:
56
void
pokemonChanged
();
57
58
public
slots:
59
void
reset
();
60
void
randomize
();
61
62
public
:
63
QVector<HoFPokemon*>
pokemon
;
64
};
HoFPokemon
One Pokemon entry within a Hall of Fame record: species, level, name.
Definition
hofpokemon.h:34
HoFRecord::pokemonNew
void pokemonNew()
Add a fresh mon.
Definition
hofrecord.cpp:79
HoFRecord::save
void save(SaveFile *saveFile, var8 ind)
Flatten record ind to the save.
Definition
hofrecord.cpp:119
HoFRecord::pokemonChanged
protected::void pokemonChanged()
The record's mon list changed.
HoFRecord::reset
void reset()
Empty this record.
Definition
hofrecord.cpp:142
HoFRecord::randomize
void randomize()
Fill with random mons.
Definition
hofrecord.cpp:151
HoFRecord::load
void load(SaveFile *saveFile=nullptr, var8 ind=0)
Expand record ind from the save.
Definition
hofrecord.cpp:88
HoFRecord::HoFRecord
HoFRecord(SaveFile *saveFile=nullptr, var8 ind=0)
Definition
hofrecord.cpp:30
HoFRecord::pokemon
QVector< HoFPokemon * > pokemon
The recorded team.
Definition
hofrecord.h:63
HoFRecord::pokemonMax
int pokemonMax()
Capacity (maxPokemon).
Definition
hofrecord.cpp:46
HoFRecord::pokemonRemove
void pokemonRemove(int ind)
Remove mon ind.
Definition
hofrecord.cpp:67
HoFRecord::pokemonAt
HoFPokemon * pokemonAt(int ind)
Mon at ind (GC-protected return).
Definition
hofrecord.cpp:51
HoFRecord::pokemonSwap
void pokemonSwap(int from, int to)
Reorder mons.
Definition
hofrecord.cpp:56
HoFRecord::pokemonCount
int pokemonCount()
Mons in this record.
Definition
hofrecord.cpp:41
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
maxPokemon
constexpr var8 maxPokemon
Mons recorded per Hall of Fame entry (a full party).
Definition
hofrecord.h:25
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
fragments
hofrecord.h
Generated by
1.17.0