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