#include <sramfile.hh>
Definition at line 161 of file sramfile.hh.
Public Member Functions | |
SRAMFile (const QString &filename) throw (InvalidSRAMFileException) | |
Creates an SRAMFile object from an SRAM file. | |
bool | save (const QString &filename) |
Saves the SRAM data to a file. | |
enum sf_arrow | getArrows () const |
Gets the kind of arrows Link is carrying. | |
void | setArrows (sf_arrow arrows) |
Sets the kind of arrows Link is carrying. | |
int | getBombCapacity () const |
Gets Link's bomb capacity. | |
void | setBombCapacity (int capacity) |
Sets Link's bomb capacity. | |
int | getBombs () const |
Gets the number of bombs Link is carrying. | |
void | setBombs (int bombs) |
Sets the number of bombs Link is carrying. | |
enum sf_candle | getCandle () const |
Gets the candle Link is carrying. | |
void | setCandle (enum sf_candle candle) |
Sets the candle Link is carrying. | |
bool | hasCompass (int level) const |
Checks if Link has the compass for a level. | |
void | setCompass (int level, bool give) |
Sets whether Link has the compass for a level. | |
int | getGame () const |
Gets the game slot being edited. | |
void | setGame (int game) |
Sets the game slot (0 - 2) being edited. | |
int | getHeartContainers () const |
Gets the number of heart containers Link has. | |
void | setHeartContainers (int containers) |
Sets the number of heart containers Link has. | |
bool | hasItem (sf_item item) const |
Checks if Link has a particular item or not. | |
void | setItem (sf_item item, bool give) |
Sets whether Link has a particular item or not. | |
int | getKeys () const |
Gets the number of keys Link has. | |
void | setKeys (int keys) |
Sets the number of keys Link has. | |
bool | hasMap (int level) const |
Checks if Link has the map for a level. | |
void | setMap (int level, bool give) |
Sets whether Link has the map for a level. | |
bool | isModified () const |
Checks if this SRAMFile has been modified or not. | |
QString | getName () const |
Gets the name of the hero. | |
void | setName (const QString &name) |
Sets the name of the hero. | |
enum sf_note | getNote () const |
Gets the location of the potion note. | |
void | setNote (enum sf_note note) |
Sets the location of the potion note. | |
int | getPlayCount () const |
Gets the game's play count. | |
void | setPlayCount (int count) |
Sets the game's play count. | |
enum sf_potion | getPotion () const |
Gets the potion Link is carrying. | |
void | setPotion (enum sf_potion potion) |
Sets the potion Link is carrying. | |
enum sf_quest | getQuest () const |
Gets the quest Link is on. | |
void | setQuest (enum sf_quest quest) |
Sets the quest Link is on. | |
enum sf_ring | getRing () const |
Gets the ring Link is wearing. | |
void | setRing (enum sf_ring ring) |
Sets the ring Link is wearing. | |
int | getRupees () const |
Gets how many rupees Link is carrying. | |
void | setRupees (int rupees) |
Sets how many rupees Link is carrying. | |
enum sf_sword | getSword () const |
Gets the sword Link has. | |
void | setSword (enum sf_sword sword) |
Sets the sword Link has. | |
bool | hasTriforce (int piece) const |
Checks if Link has a piece of the triforce. | |
void | setTriforce (int piece, bool give) |
Sets whether Link has a piece of the triforce. | |
bool | isValid (int game) const |
Returns true if a game slot is valid; false otherwise. | |
Private Member Functions | |
quint16 | checksum (int game) const |
Calculates the checksum for one of the games. | |
quint16 | getChecksum (int game) const |
Gets the checksum value for one of the games. | |
void | setChecksum (int game, quint16 checksum) |
Sets the checksum value for one of the games. | |
Private Attributes | |
int | game |
char | sram [SRAM_SIZE] |
bool | modified |
bool | valid [3] |
SRAMFile::SRAMFile | ( | const QString & | filename | ) | throw (InvalidSRAMFileException) |
Creates an SRAMFile object from an SRAM file.
filename | The SRAM filename. |
InvalidSRAMFileException | if the file is not a valid SRAM file. |
Definition at line 33 of file sramfile.cc.
quint16 SRAMFile::checksum | ( | int | game | ) | const [private] |
Calculates the checksum for one of the games.
game | The game to checksum. |
Definition at line 137 of file sramfile.cc.
quint16 SRAMFile::getChecksum | ( | int | game | ) | const [private] |
Gets the checksum value for one of the games.
game | The game. |
Definition at line 265 of file sramfile.cc.
void SRAMFile::setChecksum | ( | int | game, | |
quint16 | checksum | |||
) | [private] |
Sets the checksum value for one of the games.
game | The game. | |
checksum | The new checksum. |
Definition at line 274 of file sramfile.cc.
bool SRAMFile::save | ( | const QString & | filename | ) |
Saves the SRAM data to a file.
filename | The file to save to. |
Definition at line 169 of file sramfile.cc.
enum sf_arrow SRAMFile::getArrows | ( | ) | const |
Gets the kind of arrows Link is carrying.
Definition at line 195 of file sramfile.cc.
void SRAMFile::setArrows | ( | sf_arrow | arrows | ) |
Sets the kind of arrows Link is carrying.
arrows | The new kind of arrows. |
Definition at line 203 of file sramfile.cc.
int SRAMFile::getBombCapacity | ( | ) | const |
void SRAMFile::setBombCapacity | ( | int | capacity | ) |
Sets Link's bomb capacity.
capacity | The new bomb capacity. |
Definition at line 220 of file sramfile.cc.
int SRAMFile::getBombs | ( | ) | const |
Gets the number of bombs Link is carrying.
Definition at line 230 of file sramfile.cc.
void SRAMFile::setBombs | ( | int | bombs | ) |
Sets the number of bombs Link is carrying.
bombs | The new bomb count. |
Definition at line 238 of file sramfile.cc.
enum sf_candle SRAMFile::getCandle | ( | ) | const |
void SRAMFile::setCandle | ( | enum sf_candle | candle | ) |
Sets the candle Link is carrying.
candle | The new candle. |
Definition at line 256 of file sramfile.cc.
bool SRAMFile::hasCompass | ( | int | level | ) | const |
Checks if Link has the compass for a level.
level | The level to check. |
Definition at line 283 of file sramfile.cc.
void SRAMFile::setCompass | ( | int | level, | |
bool | give | |||
) |
Sets whether Link has the compass for a level.
level | The level to check. | |
give | true to give the compass; false to take away. |
Definition at line 296 of file sramfile.cc.
int lozsrame::SRAMFile::getGame | ( | ) | const [inline] |
Gets the game slot being edited.
Definition at line 509 of file sramfile.hh.
void lozsrame::SRAMFile::setGame | ( | int | game | ) | [inline] |
Sets the game slot (0 - 2) being edited.
game | The new game. |
Definition at line 514 of file sramfile.hh.
int SRAMFile::getHeartContainers | ( | ) | const |
Gets the number of heart containers Link has.
Definition at line 315 of file sramfile.cc.
void SRAMFile::setHeartContainers | ( | int | containers | ) |
Sets the number of heart containers Link has.
containers | The new number of heart containers. |
Definition at line 323 of file sramfile.cc.
bool SRAMFile::hasItem | ( | sf_item | item | ) | const |
Checks if Link has a particular item or not.
item | The item to check. |
Definition at line 334 of file sramfile.cc.
void SRAMFile::setItem | ( | sf_item | item, | |
bool | give | |||
) |
Sets whether Link has a particular item or not.
item | The item to set. | |
give | true to give; false to take away. |
Definition at line 342 of file sramfile.cc.
int SRAMFile::getKeys | ( | ) | const |
Gets the number of keys Link has.
Definition at line 351 of file sramfile.cc.
void SRAMFile::setKeys | ( | int | keys | ) |
Sets the number of keys Link has.
keys | The new number of keys. |
Definition at line 359 of file sramfile.cc.
bool SRAMFile::hasMap | ( | int | level | ) | const |
Checks if Link has the map for a level.
level | The level to check. |
Definition at line 369 of file sramfile.cc.
void SRAMFile::setMap | ( | int | level, | |
bool | give | |||
) |
Sets whether Link has the map for a level.
level | The level to set. | |
give | true to give the map; false to take away. |
Definition at line 382 of file sramfile.cc.
bool lozsrame::SRAMFile::isModified | ( | ) | const [inline] |
Checks if this SRAMFile has been modified or not.
Definition at line 521 of file sramfile.hh.
QString SRAMFile::getName | ( | ) | const |
void SRAMFile::setName | ( | const QString & | name | ) |
Sets the name of the hero.
name | The new name. |
Definition at line 441 of file sramfile.cc.
enum sf_note SRAMFile::getNote | ( | ) | const |
Gets the location of the potion note.
Definition at line 484 of file sramfile.cc.
void SRAMFile::setNote | ( | enum sf_note | note | ) |
Sets the location of the potion note.
note | The new location. |
Definition at line 492 of file sramfile.cc.
int SRAMFile::getPlayCount | ( | ) | const |
void SRAMFile::setPlayCount | ( | int | count | ) |
Sets the game's play count.
count | The new play count. |
Definition at line 510 of file sramfile.cc.
enum sf_potion SRAMFile::getPotion | ( | ) | const |
void SRAMFile::setPotion | ( | enum sf_potion | potion | ) |
Sets the potion Link is carrying.
potion | The new potion. |
Definition at line 529 of file sramfile.cc.
enum sf_quest SRAMFile::getQuest | ( | ) | const |
void SRAMFile::setQuest | ( | enum sf_quest | quest | ) |
Sets the quest Link is on.
quest | The new quest. |
Definition at line 546 of file sramfile.cc.
enum sf_ring SRAMFile::getRing | ( | ) | const |
void SRAMFile::setRing | ( | enum sf_ring | ring | ) |
Sets the ring Link is wearing.
ring | The new ring. |
Definition at line 563 of file sramfile.cc.
int SRAMFile::getRupees | ( | ) | const |
Gets how many rupees Link is carrying.
Definition at line 572 of file sramfile.cc.
void SRAMFile::setRupees | ( | int | rupees | ) |
Sets how many rupees Link is carrying.
rupees | The new rupees. |
Definition at line 581 of file sramfile.cc.
enum sf_sword SRAMFile::getSword | ( | ) | const |
void SRAMFile::setSword | ( | enum sf_sword | sword | ) |
Sets the sword Link has.
sword | The new sword. |
Definition at line 600 of file sramfile.cc.
bool SRAMFile::hasTriforce | ( | int | piece | ) | const |
Checks if Link has a piece of the triforce.
piece | The piece to check. |
Definition at line 609 of file sramfile.cc.
void SRAMFile::setTriforce | ( | int | piece, | |
bool | give | |||
) |
Sets whether Link has a piece of the triforce.
piece | The piece to set. | |
give | true to give; false to take away. |
Definition at line 618 of file sramfile.cc.
bool lozsrame::SRAMFile::isValid | ( | int | game | ) | const [inline] |
Returns true if a game slot is valid; false otherwise.
game | The game slot to check. |
Definition at line 526 of file sramfile.hh.
int lozsrame::SRAMFile::game [private] |
Definition at line 163 of file sramfile.hh.
char lozsrame::SRAMFile::sram[SRAM_SIZE] [private] |
Definition at line 164 of file sramfile.hh.
bool lozsrame::SRAMFile::modified [private] |
Definition at line 165 of file sramfile.hh.
bool lozsrame::SRAMFile::valid[3] [private] |
Definition at line 165 of file sramfile.hh.