| 1 | = !OrxonoxClass = |
| 2 | |
| 3 | === Description === |
| 4 | |
| 5 | OrxonoxClass is the base class of all objects and interfaces having [wiki:Identifier Identifiers]. Therefore OrxonoxClass is the direct parent of BaseObject and several interfaces like [wiki:Tickable] or [wiki:Synchronisable]. |
| 6 | |
| 7 | OrxonoxClass itself isn't of any use to the game-logic. All functions and variables are only there to create a common base for [wiki:Identifier Identifiers]. Some functions are used in macros (see CoreIncludes). |
| 8 | |
| 9 | === Inheriting from OrxonoxClass === |
| 10 | |
| 11 | Classes inheriting from OrxonoxClass '''must''' use '''virtual public''' derivation to avoid problems in the class-tree (diamond shape): |
| 12 | |
| 13 | {{{ |
| 14 | #!cpp |
| 15 | class MyInterface : virtual public OrxonoxClass |
| 16 | { |
| 17 | ... |
| 18 | }; |
| 19 | |
| 20 | }}} |
| 21 | |
| 22 | === Functions === |
| 23 | |
| 24 | * '''Identifier''': |
| 25 | * getIdentifier(): Returns the [wiki:Identifier] of an object |
| 26 | * setIdentifier(...): Sets the [wiki:Identifier] of the class (used by a macro, see [wiki:CoreIncludes] |
| 27 | |
| 28 | * '''Parents''': |
| 29 | * getParents() and createParents() are functions used by macros (see [wiki:CoreIncludes]) to create the class-tree |
| 30 | |
| 31 | * '''Comparison''': see [wiki:Identifier] for more informations |
| 32 | * isA(...) |
| 33 | * isExactlyA(...) |
| 34 | * isChildOf(...) |
| 35 | * isDirectChildOf(...) |
| 36 | * isParentOf(...) |
| 37 | * isDirectParentOf(...) |
| 38 | |
| 39 | === Illustration === |
| 40 | |
| 41 | As you can see, OrxonoxClass is on the top of the class-tree. Every other object or interface is a derivative. |
| 42 | |
| 43 | [[Image(Core:testclass_interface_orxonoxclass_tree.gif)]] |