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 93 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

static char fromNES (unsigned char letter)
 Translates a character from the Zelda II alphabet to ASCII.
static 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 39 of file SaveSlot.cc.

SaveSlot::~SaveSlot (  ) 

Destructor for a SaveSlot object.

Definition at line 50 of file SaveSlot.cc.


Member Function Documentation

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

Sets if this game has been modified or not.

Definition at line 103 of file SaveSlot.hh.

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 201 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 211 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 141 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 148 of file SaveSlot.hh.

void SaveSlot::checkForNewGame (  ) 

Fixes data for a new quest game.

Definition at line 54 of file SaveSlot.cc.

wxString SaveSlot::getName (  )  const

Gets the name of the character.

Returns:
The name.

Definition at line 80 of file SaveSlot.cc.

void SaveSlot::setName ( wxString &  value  ) 

Sets the name of the character.

Parameters:
value The new name.

Definition at line 91 of file SaveSlot.cc.

int SaveSlot::getPlayCount (  )  const

Gets the play count.

Returns:
The play count.

Definition at line 109 of file SaveSlot.cc.

void SaveSlot::setPlayCount ( unsigned char  value  ) 

Sets the play count.

Parameters:
value The new play count.

Definition at line 113 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 118 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 122 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 127 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 131 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 136 of file SaveSlot.cc.

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 140 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 145 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 149 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 159 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 163 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 168 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 172 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 177 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 181 of file SaveSlot.cc.

int SaveSlot::getKeys (  )  const

Gets the number of keys the player has.

Returns:
The number of keys.

Definition at line 192 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 196 of file SaveSlot.cc.


Friends And Related Function Documentation

friend class SRAMFile [friend]

Definition at line 94 of file SaveSlot.hh.


Member Data Documentation

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

Definition at line 97 of file SaveSlot.hh.

bool emuWorks::SaveSlot::modified [private]

Definition at line 98 of file SaveSlot.hh.

bool emuWorks::SaveSlot::valid [private]

Definition at line 98 of file SaveSlot.hh.


Generated on Mon Dec 29 01:21:33 2008 for Zelda II SRAM Editor by  doxygen 1.5.4