Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
WorldTowns Class Reference

"Visited" flags for towns – which fly destinations are unlocked. More...

#include <worldtowns.h>

Inheritance diagram for WorldTowns:
Collaboration diagram for WorldTowns:

Public Member Functions

 WorldTowns (SaveFile *saveFile=nullptr)
virtual ~WorldTowns ()
void load (SaveFile *saveFile=nullptr)
 Expand the visited-town flags from the save.
void save (SaveFile *saveFile)
 Flatten the visited-town flags to the save.
int townsCount ()
 Number of town flags (townCount).
bool townsAt (int ind)
 Is town ind visited (fly-unlocked)?
void townsSet (int ind, bool val)
 Set/clear visited for town ind.
protected::void visitedTownsChanged ()
void reset ()
 Clear all visited flags.
void randomize ()
 Randomize the visited flags.

Public Attributes

bool visitedTowns [townCount]
 Per-town visited (fly-unlocked) flags.

Detailed Description

"Visited" flags for towns – which fly destinations are unlocked.

A visitedTowns bool array of townCount flags; setting one unlocks that town as a Fly destination. QML count/at/set access. Standard expanded-node convention (see SaveFileExpanded).

See also
World.

Definition at line 35 of file worldtowns.h.

Constructor & Destructor Documentation

◆ WorldTowns()

WorldTowns::WorldTowns ( SaveFile * saveFile = nullptr)

Definition at line 32 of file worldtowns.cpp.

References load().

◆ ~WorldTowns()

WorldTowns::~WorldTowns ( )
virtual

Definition at line 37 of file worldtowns.cpp.

Member Function Documentation

◆ load()

void WorldTowns::load ( SaveFile * saveFile = nullptr)

Expand the visited-town flags from the save.

Definition at line 39 of file worldtowns.cpp.

References SaveFileToolset::getBitField(), reset(), SaveFile::toolset, townByteCount, townCount, visitedTowns, and visitedTownsChanged().

Referenced by WorldTowns().

◆ randomize()

void WorldTowns::randomize ( )

Randomize the visited flags.

Definition at line 90 of file worldtowns.cpp.

References Random::chanceSuccess(), Random::inst(), reset(), visitedTowns, and visitedTownsChanged().

Referenced by visitedTownsChanged().

◆ reset()

void WorldTowns::reset ( )

Clear all visited flags.

Definition at line 84 of file worldtowns.cpp.

References townCount, visitedTowns, and visitedTownsChanged().

Referenced by load(), randomize(), and visitedTownsChanged().

◆ save()

void WorldTowns::save ( SaveFile * saveFile)

Flatten the visited-town flags to the save.

Definition at line 56 of file worldtowns.cpp.

References SaveFileToolset::setBitField(), SaveFile::toolset, townByteCount, townCount, and visitedTowns.

◆ townsAt()

bool WorldTowns::townsAt ( int ind)

Is town ind visited (fly-unlocked)?

Definition at line 73 of file worldtowns.cpp.

References visitedTowns.

◆ townsCount()

int WorldTowns::townsCount ( )

Number of town flags (townCount).

Definition at line 68 of file worldtowns.cpp.

References townCount.

◆ townsSet()

void WorldTowns::townsSet ( int ind,
bool val )

Set/clear visited for town ind.

Definition at line 78 of file worldtowns.cpp.

References visitedTowns, and visitedTownsChanged().

◆ visitedTownsChanged()

protected::void WorldTowns::visitedTownsChanged ( )

References randomize(), and reset().

Referenced by load(), randomize(), reset(), and townsSet().

Member Data Documentation

◆ visitedTowns

bool WorldTowns::visitedTowns[townCount]

Per-town visited (fly-unlocked) flags.

Definition at line 58 of file worldtowns.h.

Referenced by load(), randomize(), reset(), save(), townsAt(), and townsSet().


The documentation for this class was generated from the following files: