91 Q_INVOKABLE
bool badgeAt(
int ind);
92 Q_INVOKABLE
void badgeSet(
int ind,
bool val);
void save(SaveFile *saveFile)
Flatten the trainer basics back to the save.
void randomizeMoney()
Randomize just the money.
QString getPlayerName()
Current trainer name (backs the property READ).
void fullSetPlayerName(QString val)
Set name AND fix non-trade mons' OT name.
void randomize()
Randomize the trainer basics (constrained).
QVector< PokemonBox * > getNonTradeMons()
All party/box mons whose OT is this trainer (not traded in).
unsigned int money
Money value.
int playerID
Trainer ID (backs the property).
SaveFile * file
Owning save (used by the full-set helpers to reach the mons).
int getPlayerId()
Current trainer ID (backs the property READ).
QString playerName
Trainer name (backs the property).
void randomizeStarter()
Randomize just the starter.
void randomizeCoins()
Randomize just the coin count.
bool badgeAt(int ind)
Is badge ind set?
void playerStarterChanged()
int badgeCount()
How many badges are set.
void fullSetPlayerId(int id)
Set ID AND fix non-trade mons' OT ID.
PlayerBasics(SaveFile *saveFile=nullptr)
< Trainer name; writing it full-sets non-trade mons (see note above).
void reset()
Blank the trainer basics.
protected::void playerNameChanged()
void fixNonTradeMons(QVector< PokemonBox * > mons)
Rewrite those mons' OT name/ID to match this trainer.
void badgeSet(int ind, bool val)
Set/clear badge ind.
void randomizeID()
Randomize just the trainer ID.
int playerStarter
Chosen starter species.
void load(SaveFile *saveFile=nullptr)
Expand the trainer basics from the save.
void setBadges(SaveFile *saveFile, var16 offset)
Write the badge bits at offset.
bool badges[maxBadges]
Per-badge owned flags, indexed by Badges::Badges_.
PokemonDBEntry * toStarter()
Resolve playerStarter to its DB entry.
A single Pokemon record – the most property-rich object in the tree.
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
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.
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
constexpr var8 maxBadges
Number of Gym badges.
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.
The eight Gym badges, in bit order, as a QML-visible enum.
@ Rainbow
Rainbow Badge (Erika).
@ Cascade
Cascade Badge (Misty).
@ Thunder
Thunder Badge (Lt. Surge).
@ Boulder
Boulder Badge (Brock).
@ Volcano
Volcano Badge (Blaine).
@ Marsh
Marsh Badge (Sabrina).
@ Earth
Earth Badge (Giovanni).
One species' complete static data – the richest entry in the db layer.