Version 1 (modified by landauf, 17 years ago) (diff) |
---|
Identifier
Description
The Identifier is a construct to identify the class of an object. All classes derived from OrxonoxClass have an Identifier, representing the class in the running game. The Identifier additionally stores all objects of its class in a list, knows the name of the class, can have a ClassFactory, knows all parents and children, stores config-values and shell-functions and provides several other functionalities.
A new class that wants an Identifier must use a macro (RegisterObject(classname) or RegisterRootObject(interfacename)) from CoreIncludes. Read the related Wiki-page for more informations.
Identifiers can be compared by using functions like isA(…) or isChildOf(…) to retrieve informations about the class-hierarchy.
You can't create an Identifier directly, because it's an abstract class. There only exist ClassIdentifiers, but you can't create them too, because they have private constructors. Identifiers are created by IdentifierDistributor?, a helper class to warrant the uniqueness of an Identifier for a class.
The SubclassIdentifier is a class, that can store and act like an Identifier, but has a given base-class. Read the related Wiki-page for more informations.