Drag[en]gine Script Module DragonScript
1.21
|
Helper class for handling flags for persistency. More...
Public Member Functions | |
bool | getAt (int flag) |
Flag is set. More... | |
int | getCount () |
Number of flags. More... | |
PersistencyFlags | new (int flagCount) |
Create persistency flags. More... | |
PersistencyFlags | new (int flagCount, FileReader reader) |
Read flags from file writer. More... | |
void | setAt (int flag, bool value) |
Set flag. More... | |
String | toString () |
String representation of object. More... | |
void | writeToFile (FileWriter writer) |
Write flags to file writer. More... | |
Public Attributes | |
Array | pFlags |
Array of flags as boolean. More... | |
Helper class for handling flags for persistency.
Simplifies handling flags persisted in files reducing coding effort. For reading provides support to query set and cleared bits. For writing provides support to set and clear bits.
Depending on the number of flags set in the constructor the flags are saved as one or more consecutive bytes.
bool Dragengine.LoadSave.PersistencyFlags.getAt | ( | int | flag | ) |
Flag is set.
EInvalidParam | flag is less than 0 or larger or equal than getFlagCount(). |
int Dragengine.LoadSave.PersistencyFlags.getCount | ( | ) |
Number of flags.
PersistencyFlags Dragengine.LoadSave.PersistencyFlags.new | ( | int | flagCount | ) |
Create persistency flags.
The default value of all flags is false.
EInvalidParam | flagCount is less than 1. |
PersistencyFlags Dragengine.LoadSave.PersistencyFlags.new | ( | int | flagCount, |
FileReader | reader | ||
) |
Read flags from file writer.
EInvalidParam | flagCount is less than 1. |
EInvalidParam | reader is null. |
void Dragengine.LoadSave.PersistencyFlags.setAt | ( | int | flag, |
bool | value | ||
) |
Set flag.
EInvalidParam | flag is less than 0 or larger or equal than getFlagCount(). |
String Dragengine.LoadSave.PersistencyFlags.toString | ( | ) |
String representation of object.
void Dragengine.LoadSave.PersistencyFlags.writeToFile | ( | FileWriter | writer | ) |
Write flags to file writer.
Array Dragengine.LoadSave.PersistencyFlags.pFlags |
Array of flags as boolean.