Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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.
int getCount ()
 Number of flags.
PersistencyFlags new (int flagCount)
 Create persistency flags.
PersistencyFlags new (int flagCount, FileReader reader)
 Read flags from file writer.
void setAt (int flag, bool value)
 Set flag.
String toString ()
 String representation of object.
void writeToFile (FileWriter writer)
 Write flags to file writer.

Public Attributes

Array pFlags
 Array of flags as boolean.

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

Referenced by toString().

◆ getCount()

int Dragengine.LoadSave.PersistencyFlags.getCount ( )

Number of flags.

References pFlags.

Referenced by toString().

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

References new(), and pFlags.

Referenced by new().

◆ 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().

References pFlags.

Referenced by toString().

◆ toString()

String Dragengine.LoadSave.PersistencyFlags.toString ( )

String representation of object.

References getAt(), getCount(), pFlags, setAt(), toString(), and writeToFile().

Referenced by toString().

◆ writeToFile()

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

Write flags to file writer.

Referenced by toString().

Member Data Documentation

◆ pFlags

Array Dragengine.LoadSave.PersistencyFlags.pFlags

Array of flags as boolean.

Referenced by getCount(), new(), setAt(), and toString().


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