|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.huguesjohnson.hapsby.SaveGame
public class SaveGame
Class to read & write values to a file.
| Constructor Summary | |
|---|---|
SaveGame(java.io.File file)
Create a new SaveGame, opens the file passed in the constructor. |
|
SaveGame(java.lang.String filePath)
Create a new SaveGame, opens the file passed in the constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Close the save game. |
int |
getIntValue(int offset,
int length,
SaveGameProperty.ByteOrder byteOrder)
Returns an integer value from the save game. |
java.lang.String |
getStringValue(int offset,
int length,
SaveGameProperty.ByteOrder byteOrder)
Returns a string value from a save game. |
void |
setIntValue(int offset,
int length,
int value,
SaveGameProperty.ByteOrder byteOrder)
Writes an integer value to the save game. |
void |
setStringValue(int offset,
int length,
java.lang.String value,
SaveGameProperty.ByteOrder byteOrder)
Writes a string value to the save game. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SaveGame(java.lang.String filePath)
SaveGame, opens the file passed in the constructor.
filePath - Full path to the save game to open.public SaveGame(java.io.File file)
SaveGame, opens the file passed in the constructor.
file - Save game file to open.| Method Detail |
|---|
public void close()
public int getIntValue(int offset,
int length,
SaveGameProperty.ByteOrder byteOrder)
offset - Decimal value pointing to the first byte of the value to retrieve.length - Length (number of bytes) of the value.byteOrder - The byte order of the value.
public void setIntValue(int offset,
int length,
int value,
SaveGameProperty.ByteOrder byteOrder)
offset - Decimal value pointing to the first byte of the value to store.length - Length (number of bytes) of the value.value - The decimal number to be stored at offset X (offset*length).byteOrder - The byte order of the value to store.
public void setStringValue(int offset,
int length,
java.lang.String value,
SaveGameProperty.ByteOrder byteOrder)
offset - Decimal value pointing to the first byte of the string to store.length - Length (number of bytes) of the string.value - The string to be stored at offset.byteOrder - The byte order of the string (just in case there's some oddball save game where strings are stored in reverse).
public java.lang.String getStringValue(int offset,
int length,
SaveGameProperty.ByteOrder byteOrder)
offset - Decimal value pointing to the first byte of the string to retrieve.length - Length (number of bytes) of the string.byteOrder - The byte order of the string (just in case there's some oddball save game where strings are stored in reverse).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||