Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

emuWorks::SaveSlot Class Reference

#include <SaveSlot.hh>

List of all members.


Detailed Description

Class encapsulating a SaveSlot for a Zelda II game.

Definition at line 90 of file SaveSlot.hh.

Public Member Functions

 SaveSlot (const char *nvram)
 Constructor for a SaveSlot.
 ~SaveSlot ()
 Destructor for a SaveSlot object.
bool isModified () const
 Queries if this SaveSlot has been modified;.
bool isValid () const
 Queries if this SaveSlot is valid.
void checkForNewGame ()
 Fixes data for a new quest game.
wxString getName () const
 Gets the name of the character.
void setName (wxString &value)
 Sets the name of the character.
int getPlayCount () const
 Gets the play count.
void setPlayCount (unsigned char value)
 Sets the play count.
bool hasTriforce () const
 Queries if the player has saved the Triforce before.
void setTriforce (bool value)
 Sets whether this player has saved the Triforce before.
int getLevel (int which) const
 Gets one of the experience level elements.
void setLevel (int which, unsigned char value)
 Sets one of the experience level elements.
int getContainers (int which) const
 Gets one of the container values.
void setContainers (int which, unsigned char value)
 Sets one of the container values.
bool hasTechnique (int technique) const
 Queries if the player has a sword technique.
void setTechnique (int technique, bool value)
 Sets if the player has a sword technique or not.
bool hasSpell (int spell) const
 Queries if the player has a certain spell.
void setSpell (int spell, bool value)
 Sets if the player has a certain spell.
bool hasItem (int item) const
 Queries if the player has a certain item.
void setItem (int item, bool value)
 Sets if the player has a certain item.
bool hasSeal (int palace) const
 Queries if the player has sealed a certain palace.
void setSeal (int palace, bool value)
 Sets if the player has sealed a certain palace.
int getKeys () const
 Gets the number of keys the player has.
void setKeys (unsigned char value)
 Sets the number of keys the player has.

Private Member Functions

void setModified (bool modified=true)
 Sets if this game has been modified or not.

Static Private Member Functions

char fromNES (unsigned char letter)
 Translates a character from the Zelda II alphabet to ASCII.
unsigned char toNES (char letter)
 Translates a character from ASCII to the Zelda II alphabet.

Private Attributes

unsigned char * nvram
bool modified
bool valid

Friends

class SRAMFile


Constructor & Destructor Documentation

SaveSlot::SaveSlot const char *  nvram  ) 
 

Constructor for a SaveSlot.

Parameters:
nvram The SRAM data for this SaveSlot.

Definition at line 36 of file SaveSlot.cc.

SaveSlot::~SaveSlot  ) 
 

Destructor for a SaveSlot object.

Definition at line 51 of file SaveSlot.cc.


Member Function Documentation

void SaveSlot::checkForNewGame  ) 
 

Fixes data for a new quest game.

Definition at line 55 of file SaveSlot.cc.

char SaveSlot::fromNES unsigned char  letter  )  [static, private]
 

Translates a character from the Zelda II alphabet to ASCII.

Parameters:
letter The letter to translate.
Returns:
The translated letter.

Definition at line 202 of file SaveSlot.cc.

int SaveSlot::getContainers int  which  )  const
 

Gets one of the container values.

Parameters:
which Which container value to get. Valid values are one of Containers enumeration.
Returns:
The number of containers.

Definition at line 137 of file SaveSlot.cc.

int SaveSlot::getKeys  )  const
 

Gets the number of keys the player has.

Returns:
The number of keys.

Definition at line 193 of file SaveSlot.cc.

int SaveSlot::getLevel int  which  )  const
 

Gets one of the experience level elements.

Parameters:
which Which level to retrieve. Valid values are one of the Levels enumeration.
Returns:
The experience level.

Definition at line 128 of file SaveSlot.cc.

wxString SaveSlot::getName  )  const
 

Gets the name of the character.

Returns:
The name.

Definition at line 81 of file SaveSlot.cc.

int SaveSlot::getPlayCount  )  const
 

Gets the play count.

Returns:
The play count.

Definition at line 110 of file SaveSlot.cc.

bool SaveSlot::hasItem int  item  )  const
 

Queries if the player has a certain item.

Parameters:
item Which item. Valid values are in the Items enumeration.
Returns:
true if they have it; false otherwise.

Definition at line 169 of file SaveSlot.cc.

bool SaveSlot::hasSeal int  palace  )  const
 

Queries if the player has sealed a certain palace.

Parameters:
palace Which palace. Valid values are 0-5.
Returns:
true if they have sealed it; false otherwise.

Definition at line 178 of file SaveSlot.cc.

bool SaveSlot::hasSpell int  spell  )  const
 

Queries if the player has a certain spell.

Parameters:
spell Which spell. Valid values are in the Spells enumeration.
Returns:
true if they have it; false otherwise.

Definition at line 160 of file SaveSlot.cc.

bool SaveSlot::hasTechnique int  technique  )  const
 

Queries if the player has a sword technique.

Parameters:
technique Which technique to check for. Valid values are in the Techniques enumeration.
Returns:
true if they have the technique; false otherwise.

Definition at line 146 of file SaveSlot.cc.

bool SaveSlot::hasTriforce  )  const
 

Queries if the player has saved the Triforce before.

Returns:
true if they have; false otherwise.

Definition at line 119 of file SaveSlot.cc.

bool emuWorks::SaveSlot::isModified  )  const [inline]
 

Queries if this SaveSlot has been modified;.

Returns:
true if modified; false otherwise.

Definition at line 109 of file SaveSlot.hh.

bool emuWorks::SaveSlot::isValid  )  const [inline]
 

Queries if this SaveSlot is valid.

Returns:
true if valid; false otherwise.

Definition at line 116 of file SaveSlot.hh.

void SaveSlot::setContainers int  which,
unsigned char  value
 

Sets one of the container values.

Parameters:
which Which container value to set. Valid values are one of Containers enumeration.
value The new container value.

Definition at line 141 of file SaveSlot.cc.

void SaveSlot::setItem int  item,
bool  value
 

Sets if the player has a certain item.

Parameters:
item Which item. Valid values are in the Items enumeration.
value true to have the item; false otherwise.

Definition at line 173 of file SaveSlot.cc.

void SaveSlot::setKeys unsigned char  value  ) 
 

Sets the number of keys the player has.

Parameters:
value The new number of keys.

Definition at line 197 of file SaveSlot.cc.

void SaveSlot::setLevel int  which,
unsigned char  value
 

Sets one of the experience level elements.

Parameters:
which Which level to set. Valid values are one of the Levels enumeration.
value The new experience level.

Definition at line 132 of file SaveSlot.cc.

void emuWorks::SaveSlot::setModified bool  modified = true  )  [inline, private]
 

Sets if this game has been modified or not.

Definition at line 293 of file SaveSlot.hh.

void SaveSlot::setName wxString &  value  ) 
 

Sets the name of the character.

Parameters:
value The new name.

Definition at line 92 of file SaveSlot.cc.

void SaveSlot::setPlayCount unsigned char  value  ) 
 

Sets the play count.

Parameters:
value The new play count.

Definition at line 114 of file SaveSlot.cc.

void SaveSlot::setSeal int  palace,
bool  value
 

Sets if the player has sealed a certain palace.

Parameters:
palace Which palace. Valid values are 0-5.
value true to seal; false otherwise.

Definition at line 182 of file SaveSlot.cc.

void SaveSlot::setSpell int  spell,
bool  value
 

Sets if the player has a certain spell.

Parameters:
spell Which spell. Valid values are in the Spells enumeration.
value true to have the spell; false otherwise.

Definition at line 164 of file SaveSlot.cc.

void SaveSlot::setTechnique int  technique,
bool  value
 

Sets if the player has a sword technique or not.

Parameters:
technique Which technique to set. Valid values are in the Techniques enumeration.
value true to have the technique; false otherwise.

Definition at line 150 of file SaveSlot.cc.

void SaveSlot::setTriforce bool  value  ) 
 

Sets whether this player has saved the Triforce before.

Parameters:
value true if they have; false otherwise.

Definition at line 123 of file SaveSlot.cc.

unsigned char SaveSlot::toNES char  letter  )  [static, private]
 

Translates a character from ASCII to the Zelda II alphabet.

Parameters:
letter The letter to translate.
Returns:
The translated letter.

Definition at line 212 of file SaveSlot.cc.


Friends And Related Function Documentation

friend class SRAMFile [friend]
 

Definition at line 287 of file SaveSlot.hh.


Member Data Documentation

bool emuWorks::SaveSlot::modified [private]
 

Definition at line 314 of file SaveSlot.hh.

unsigned char* emuWorks::SaveSlot::nvram [private]
 

Definition at line 313 of file SaveSlot.hh.

bool emuWorks::SaveSlot::valid [private]
 

Definition at line 314 of file SaveSlot.hh.


Generated on Fri Dec 10 11:33:56 2004 for Zelda II SRAM Editor by  doxygen 1.3.9.1