A game setting that is a part of a group of settings that can be OR'ed logically as a single integer. More...
#include <serverstructs.h>
Public Member Functions | |
DMFlag (const QString &internalName, unsigned value) | |
DMFlag (const QString &internalName, unsigned value, const QString &name) | |
const QString & | internalName () const |
Uniquely identifiable name within its DMFlagsSection, ex. "Jump is allowed" or "jumpisallowed". More... | |
bool | isValid () const |
Valid objects have value() greater than zero. More... | |
const QString & | name () const |
User-displayable, translateable name of the DMFlag, ex. "Jump is allowed". More... | |
unsigned | value () const |
Bits that represent this flag (usually just a single '1' bit). More... | |
A game setting that is a part of a group of settings that can be OR'ed logically as a single integer.
DMFlag is basically a setting that is toggleable between enabled/disabled state, and a bunch of DMFlags can be represented as bitflags that can be OR'ed, XOR'ed, and AND'ed together.
DMFlag objects can be put into DMFlagsSection collection.
DMFlag is bound by the same human-readable name and 'internal' name rules as the DMFlagsSection class. Refer to the documentation of that class to see the details. Remember that it's absolutely forbidden to use QObject::tr() in the 'internal' name. Each DMFlag should have an unique name within its DMFlagsSection.
This structure is safe to copy.
Definition at line 58 of file serverstructs.h.
const QString & DMFlag::internalName | ( | ) | const |
Uniquely identifiable name within its DMFlagsSection, ex. "Jump is allowed" or "jumpisallowed".
Definition at line 73 of file serverstructs.cpp.
bool DMFlag::isValid | ( | ) | const |
Valid objects have value() greater than zero.
Invalid objects can be treated as 'Null'.
Definition at line 78 of file serverstructs.cpp.
const QString & DMFlag::name | ( | ) | const |
User-displayable, translateable name of the DMFlag, ex. "Jump is allowed".
Definition at line 83 of file serverstructs.cpp.
unsigned DMFlag::value | ( | ) | const |
Bits that represent this flag (usually just a single '1' bit).
Definition at line 88 of file serverstructs.cpp.