|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The player's active party – a specialized PokemonStorageBox. More...
#include <playerpokemon.h>
Public Member Functions | |
| PlayerPokemon (SaveFile *saveFile=nullptr) | |
| virtual | ~PlayerPokemon () |
| virtual void | load (SaveFile *saveFile=nullptr, var16 boxOffset=0) |
Expand the party from the save (boxOffset locates the party block). | |
| virtual void | save (SaveFile *saveFile, var16 boxOffset=0) |
Flatten the party back to the save (boxOffset locates the party block). | |
| PokemonParty * | partyAt (int ind) |
Party member at ind (GC-protected return). | |
| virtual void | randomize (PlayerBasics *basics) |
Randomize the party; basics supplies starter/OT context. | |
| virtual void | pokemonNew () |
| Add/initialize a fresh party Pokemon. | |
| Public Member Functions inherited from PokemonStorageBox | |
| PokemonStorageBox (int maxSize=boxMaxPokemon, SaveFile *saveFile=nullptr, var16 boxOffset=0) | |
| < How many mons are in the box. | |
| virtual | ~PokemonStorageBox () |
| int | pokemonCount () |
| Number of mons present. | |
| int | pokemonMax () |
| Capacity (maxSize). | |
| bool | isFull () |
| At capacity. | |
| PokemonBox * | pokemonAt (int ind) |
Mon at ind (GC-protected return). | |
| void | reset () |
| Empty the box. | |
| bool | pokemonMove (int from, int to) |
| Reorder a mon within the box. | |
| void | pokemonRemove (int ind) |
Remove the mon at ind. | |
| bool | relocateAll (PokemonStorageBox *dst) |
Move every mon into dst. | |
| virtual bool | relocateOne (PokemonStorageBox *dst, int ind) |
Move one mon into dst. | |
Additional Inherited Members | |
| Public Attributes inherited from PokemonStorageBox | |
| bool | isParty = false |
| True if this box is actually the party (affects record format). | |
| QVector< PokemonBox * > | pokemon |
| The stored mons. | |
| int | maxSize = 0 |
| Capacity. | |
| SaveFile * | file |
| Owning save. | |
| Protected Member Functions inherited from PokemonStorageBox | |
| void | pokemonChanged () |
| Box contents changed. | |
| void | pokemonMoveChange (int from, int to) |
| A mon moved slot. | |
| void | pokemonRemoveChange (int ind) |
| A mon was removed. | |
| void | pokemonInsertChange () |
| A mon was inserted. | |
| void | pokemonResetChange () |
| The box was reset. | |
| Protected Attributes inherited from PokemonStorageBox | |
| : void beforePokemonRelocate(PokemonBox* item) | |
| Emitted before a relocate so models can clean up. | |
The player's active party – a specialized PokemonStorageBox.
The party is stored just like a PC box but with party-only extras (live stats), so it inherits PokemonStorageBox and overrides load()/save() to read/write at the party's offset and slot count (maxParty). Members are PokemonParty entries (a PokemonBox plus the computed in-battle stats).
Definition at line 41 of file playerpokemon.h.
| PlayerPokemon::PlayerPokemon | ( | SaveFile * | saveFile = nullptr | ) |
Definition at line 34 of file playerpokemon.cpp.
References boxMaxPokemon, PokemonStorageBox::isParty, load(), PokemonStorageBox::maxSize, and PokemonStorageBox::PokemonStorageBox().
|
virtual |
Definition at line 42 of file playerpokemon.cpp.
Expand the party from the save (boxOffset locates the party block).
Reimplemented from PokemonStorageBox.
Definition at line 44 of file playerpokemon.cpp.
References PokemonStorageBox::file, PokemonStorageBox::pokemon, PokemonStorageBox::pokemonChanged(), PokemonStorageBox::pokemonInsertChange(), PokemonStorageBox::reset(), and SaveFile::toolset.
Referenced by PlayerPokemon().
| PokemonParty * PlayerPokemon::partyAt | ( | int | ind | ) |
Party member at ind (GC-protected return).
Definition at line 99 of file playerpokemon.cpp.
References PokemonStorageBox::pokemon, and qmlCppOwned().
|
virtual |
Add/initialize a fresh party Pokemon.
Reimplemented from PokemonStorageBox.
Definition at line 147 of file playerpokemon.cpp.
References PokemonParty::convertToParty(), PokemonStorageBox::file, PokemonStorageBox::maxSize, PokemonBox::newPokemon(), PokemonStorageBox::pokemon, PokemonStorageBox::pokemonChanged(), PokemonStorageBox::pokemonInsertChange(), and PokemonRandom::Random_Starters.
|
virtual |
Randomize the party; basics supplies starter/OT context.
Reimplemented from PokemonStorageBox.
Definition at line 104 of file playerpokemon.cpp.
References MovesDB::inst(), Random::inst(), PokemonStorageBox::pokemon, PokemonStorageBox::pokemonChanged(), PokemonStorageBox::pokemonInsertChange(), Random::rangeInclusive(), and PokemonStorageBox::reset().
Flatten the party back to the save (boxOffset locates the party block).
Reimplemented from PokemonStorageBox.
Definition at line 71 of file playerpokemon.cpp.
References PokemonStorageBox::pokemon, SaveFileToolset::setByte(), and SaveFile::toolset.