Simple class containing metadata info for a group of states. More...
Public Member Functions | |
StateGroupInfo () | |
Constructs an empty object. More... | |
StateGroupInfo (int id, const Str &name) | |
Constructs a new object with the given state group id and name. More... | |
StateGroupInfo (const StateGroupInfo &other) | |
Constructs a new StateGroupInfo that is a copy of other. More... | |
StateGroupInfo & | operator= (const StateGroupInfo &rhs) |
Assigns rhs to this state group info and returns a reference to this state group info. More... | |
int | id () const |
Returns the state group id. More... | |
Str | name () const |
Returns the state group name. More... | |
size_t | stateCount () const |
Returns the number of states in the group. More... | |
int | stateId (size_t index) const |
Returns id of the state at the given index. More... | |
void | addStateId (int stateId) |
Adds a state to this group, defined by its id. There must not be duplicates. More... | |
bool | hasStateId (int stateId) const |
Returns true if the given state is in the group. More... | |
void | clear () |
Clears the states in the group. More... | |
Simple class containing metadata info for a group of states.
A state group info contains:
Default state group id is -1 which indicates an invalid id.
cee::ug::StateGroupInfo::StateGroupInfo | ( | ) |
Constructs an empty object.
Default id is -1 (invalid)
cee::ug::StateGroupInfo::StateGroupInfo | ( | int | id, |
const Str & | name | ||
) |
Constructs a new object with the given state group id and name.
cee::ug::StateGroupInfo::StateGroupInfo | ( | const StateGroupInfo & | other | ) |
Constructs a new StateGroupInfo that is a copy of other.
void cee::ug::StateGroupInfo::addStateId | ( | int | stateId | ) |
Adds a state to this group, defined by its id. There must not be duplicates.
void cee::ug::StateGroupInfo::clear | ( | ) |
Clears the states in the group.
bool cee::ug::StateGroupInfo::hasStateId | ( | int | stateId | ) | const |
Returns true if the given state is in the group.
int cee::ug::StateGroupInfo::id | ( | ) | const |
Returns the state group id.
Returns -1 if this state group info object is invalid.
Str cee::ug::StateGroupInfo::name | ( | ) | const |
Returns the state group name.
StateGroupInfo & cee::ug::StateGroupInfo::operator= | ( | const StateGroupInfo & | rhs | ) |
Assigns rhs to this state group info and returns a reference to this state group info.
size_t cee::ug::StateGroupInfo::stateCount | ( | ) | const |
Returns the number of states in the group.
int cee::ug::StateGroupInfo::stateId | ( | size_t | index | ) | const |
Returns id of the state at the given index.