Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 7 and Version 8 of code/doc/BaseObject


Ignore:
Timestamp:
Oct 7, 2008, 7:18:32 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/BaseObject

    v7 v8  
    44== Description ==
    55
    6 In Orxonox, there are some classes refered to be "objects". In this context an object is not an instance of a class, but a class beeing relevant to the game-logic. Examples of objects are: A ship (but not the model), a particle effect (but not the particles themselfes), a trigger (which might be totally abstract like "finish the game after 20 minutes"), a HUD (but not the graphpics). Examples of classes not beeing objects are: Interfaces (but objects might inherit from them), graphical components (meshes, textures, sprites, billboards, ...), helper classes ([wiki:Timer], ...), classes in external libraries ([wiki:Coding/networking network], audio, [wiki:Core core], ...).
     6In Orxonox, there are some classes refered to be "objects". In this context an object is not an instance of a class, but a class beeing relevant to the game-logic. Examples of objects are: A ship (but not the model), a particle effect (but not the particles themselfes), a trigger (which might be totally abstract like "finish the game after 20 minutes"), a HUD (but not the graphics). Examples of classes not beeing objects are: Interfaces (but objects might inherit from them), graphical components (meshes, textures, sprites, billboards, ...), helper classes ([wiki:Timer], ...), classes in external libraries ([wiki:Network network], audio, [wiki:Core core], ...).
    77
    8 To differ objects from other classes, they derive from BaseObject. They might have other parents like interfaces or listeners, but they '''must''' inherit from BaseObject. The other way round you can cast every object to BaseObject, even if the only thing you know is it's a derivative of an interface like [wiki:Tickable] or [wiki:Synchronisable]. The BaseObject itself inherits from OrxonoxClass.
     8To differ objects from other classes, they all derive from !BaseObject. They might have other parents like interfaces or listeners, but they '''must''' inherit from !BaseObject. The other way round you can cast every object to !BaseObject, even if the only thing you know is it's a derivative of an interface like [wiki:Tickable] or [wiki:Synchronisable].
     9
     10The !BaseObject itself inherits from [wiki:OrxonoxClass].
    911
    1012
    1113== Functions ==
    1214
    13 The BaseObject provides several functions and states:
     15The !BaseObject provides several functions and states:
    1416
    15 ---to come---
     17=== XMLPort ===
     18 * '''XMLPort('''''element, mode''''')''' is a virtual function defining rules to parse an xml element and assign values and subobjects to the object. This is used by the [wiki:Loader]. See [wiki:XMLPort] for more information.
     19
     20=== Name ===
     21 * '''setName('''''name''''')''': Sets the name of the object. This involves a call to changedName() (see below).
     22 * '''getName()''': Returns the name of the object (if set).
     23 * '''changedName()''': A virtual function which gets called if the name of the object changes. Can be changed by a subclass if the name is somehow important and changes have to be tracked.
     24
     25=== Activity ===
     26 * '''setActive('''''bActive''''')''': Changes the activity of the object. Every object may define it's own definition of "activity" (see changedActivity).
     27 * '''isActive()''': Returns true if the object is active.
     28 * '''changedActivity()''': A virtual function which gets called if the activity of the object changes. This allows the class to implement it's own definition of "activity".
     29
     30=== Visibility ===
     31 * '''setVisible('''''bVisible''''')''': Changes the visibility of the object. Every object may define it's own definition of "visibility" (see changedVisibility).
     32 * '''isVisible()''': Returns true if the object is visiblee.
     33 * '''changedVisibility()''': A virtual function which gets called if the visibility of the object changes. This allows the class to implement it's own definition of "visibility".
     34
     35=== Loader ===
     36There are a few functions only relevant to the [wiki:Loader] and [wiki:Namespace Namespaces]:
     37 * '''setLevel('''''level''''')'''
     38 * '''getLevel()'''
     39
     40 * '''setNamespace('''''namespace''''')'''
     41 * '''getNamespace()'''
    1642
    1743== Illustration ==
    1844
    19 In this illustration of a class-tree (Test.h), the classes A1, A2 and A3 (and all derivatives) are "objects", because they inherit from BaseObject. As you can see, there are some Interfaces. Interfaces aren't connected with the BaseObject, they're on the same level. But they all inherit from OrxonoxClass, but this isn't relevant to the game-logic.
     45In this illustration of a class-tree (Test.h), the classes A1, A2 and A3 (and all derivatives) are "objects", because they inherit from !BaseObject. As you can see, there are some Interfaces. Interfaces aren't connected with the !BaseObject, they're on the same level. They all inherit from [wiki:OrxonoxClass], but this isn't relevant to the game-logic.
    2046
    2147[[Image(Core:testclass_interface_orxonoxclass_tree.gif)]]