Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of code/doc/OrxonoxClass


Ignore:
Timestamp:
Feb 24, 2008, 9:45:26 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/OrxonoxClass

    v1 v1  
     1= !OrxonoxClass =
     2
     3=== Description ===
     4
     5OrxonoxClass 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
     7OrxonoxClass 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
     11Classes inheriting from OrxonoxClass '''must''' use '''virtual public''' derivation to avoid problems in the class-tree (diamond shape):
     12
     13{{{
     14#!cpp
     15class 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
     41As 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)]]