Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
player.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>
19
20#include "./playerbasics.h"
21#include "./playerpokedex.h"
22#include "./playerpokemon.h"
24
25class PlayerBasics;
26class PlayerPokedex;
27class PlayerPokemon;
28class ItemStorageBox;
29
30class SaveFile;
31
41class SAVEFILE_AUTOPORT Player : public QObject
42{
43 Q_OBJECT
44
45 Q_PROPERTY(PlayerBasics* basics MEMBER basics NOTIFY basicsChanged)
46 Q_PROPERTY(ItemStorageBox* items MEMBER items NOTIFY itemsChanged)
47 Q_PROPERTY(PlayerPokedex* pokedex MEMBER pokedex NOTIFY pokedexChanged)
48 Q_PROPERTY(PlayerPokemon* pokemon MEMBER pokemon NOTIFY pokemonChanged)
49
50public:
51 Player(SaveFile* saveFile = nullptr);
52 virtual ~Player();
53
54 void load(SaveFile* saveFile = nullptr);
55 void save(SaveFile* saveFile);
56
57signals:
62
63public slots:
64 void reset();
65 void randomize();
66
67public:
68 PlayerBasics* basics = nullptr;
69 ItemStorageBox* items = nullptr;
72};
A container of Items – either the trainer's bag or a PC item box.
The trainer's headline values: name, ID, money, coins, badges, starter.
The player's Pokedex: a seen flag and an owned flag per species.
The player's active party – a specialized PokemonStorageBox.
PlayerBasics * basics
Definition player.h:68
void load(SaveFile *saveFile=nullptr)
Expand the player regions from the save.
Definition player.cpp:47
void reset()
Blank all player regions.
Definition player.cpp:66
protected::void basicsChanged()
PlayerPokemon * pokemon
Definition player.h:71
Player(SaveFile *saveFile=nullptr)
< Name, ID, money, coins, badges, starter.
Definition player.cpp:29
void randomize()
Randomize all player regions (constrained).
Definition player.cpp:74
void itemsChanged()
void save(SaveFile *saveFile)
Flatten the player regions back to the save.
Definition player.cpp:58
void pokemonChanged()
ItemStorageBox * items
Definition player.h:69
void pokedexChanged()
PlayerPokedex * pokedex
Definition player.h:70
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
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.