DMFlag Class Reference

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)
 
 DMFlag (const DMFlag &other)
 
const QString & internalName () const
 Uniquely identifiable name within its DMFlagsSection, ex. "Jump is allowed" or "jumpisallowed".
 
bool isValid () const
 Valid objects have value() greater than zero.
 
const QString & name () const
 User-displayable, translateable name of the DMFlag, ex. "Jump is allowed".
 
DMFlagoperator= (const DMFlag &other)
 
unsigned value () const
 Bits that represent this flag (usually just a single '1' bit).
 

Detailed Description

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 62 of file serverstructs.h.

Member Function Documentation

const QString & DMFlag::internalName ( ) const

Uniquely identifiable name within its DMFlagsSection, ex. "Jump is allowed" or "jumpisallowed".

See Also
DMFlagsSection::internalName().

Definition at line 87 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 92 of file serverstructs.cpp.

const QString & DMFlag::name ( ) const

User-displayable, translateable name of the DMFlag, ex. "Jump is allowed".

Definition at line 97 of file serverstructs.cpp.

unsigned DMFlag::value ( ) const

Bits that represent this flag (usually just a single '1' bit).

Definition at line 102 of file serverstructs.cpp.


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