Drag[en]gine Script Module DragonScript  1.23
Dragengine.LoadSave.PersistencyFlags Class Reference

Helper class for handling flags for persistency. More...

Inheritance diagram for Dragengine.LoadSave.PersistencyFlags:

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

Detailed Description

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.

Member Function Documentation

◆ getAt()

bool Dragengine.LoadSave.PersistencyFlags.getAt ( int  flag)

Flag is set.

Exceptions
EInvalidParamflag is less than 0 or larger or equal than getFlagCount().

◆ getCount()

int Dragengine.LoadSave.PersistencyFlags.getCount ( )

Number of flags.

◆ new() [1/2]

PersistencyFlags Dragengine.LoadSave.PersistencyFlags.new ( int  flagCount)

Create persistency flags.

The default value of all flags is false.

Exceptions
EInvalidParamflagCount is less than 1.

◆ new() [2/2]

PersistencyFlags Dragengine.LoadSave.PersistencyFlags.new ( int  flagCount,
FileReader  reader 
)

Read flags from file writer.

Exceptions
EInvalidParamflagCount is less than 1.
EInvalidParamreader is null.

◆ setAt()

void Dragengine.LoadSave.PersistencyFlags.setAt ( int  flag,
bool  value 
)

Set flag.

Exceptions
EInvalidParamflag is less than 0 or larger or equal than getFlagCount().

◆ toString()

String Dragengine.LoadSave.PersistencyFlags.toString ( )

String representation of object.

◆ writeToFile()

void Dragengine.LoadSave.PersistencyFlags.writeToFile ( FileWriter  writer)

Write flags to file writer.

Member Data Documentation

◆ pFlags

Array Dragengine.LoadSave.PersistencyFlags.pFlags

Array of flags as boolean.


The documentation for this class was generated from the following file: