Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
playerpokemon.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>
23
24class SaveFile;
25class PlayerBasics;
26class PokemonParty;
27
28constexpr var8 maxParty = 6;
29
42{
43 Q_OBJECT
44
45public:
46 PlayerPokemon(SaveFile* saveFile = nullptr);
47 virtual ~PlayerPokemon();
48
50 virtual void load(SaveFile* saveFile = nullptr, var16 boxOffset = 0);
52 virtual void save(SaveFile* saveFile, var16 boxOffset = 0);
53
54 Q_INVOKABLE PokemonParty* partyAt(int ind);
55
56public slots:
57 virtual void randomize(PlayerBasics* basics);
58 virtual void pokemonNew();
59};
The trainer's headline values: name, ID, money, coins, badges, starter.
PokemonParty * partyAt(int ind)
Party member at ind (GC-protected return).
PlayerPokemon(SaveFile *saveFile=nullptr)
A party Pokemon: a PokemonBox plus the five pre-generated battle stats.
virtual void randomize(PlayerBasics *basics)
Fill with constrained random mons.
virtual void pokemonNew()
Add a fresh mon.
virtual void load(SaveFile *saveFile=nullptr, var16 boxOffset=0)
Expand the box from the save.
virtual void save(SaveFile *saveFile, var16 boxOffset=0)
Flatten the box to the save.
PokemonStorageBox(int maxSize=boxMaxPokemon, SaveFile *saveFile=nullptr, var16 boxOffset=0)
< How many mons are in the box.
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
Project-wide fixed-width integer aliases (var8, var16, ...).
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition types.h:124
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:125
constexpr var8 maxParty
Maximum Pokemon in the active party.
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.