Changes between Version 1 and Version 2 of ~archive/BaseObject
- Timestamp:
- Nov 27, 2007, 11:17:43 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
~archive/BaseObject
v1 v2 1 = BaseObject =2 The BaseObject is the top-most !SuperClass of (most but not) all Classes in orxonox.1 = !BaseObject = 2 The !BaseObject is the top-most !SuperClass of (most but not) all Classes in orxonox. 3 3 4 4 source:/trunk/src/lib/lang/base_object.h#HEAD [[br]] … … 7 7 8 8 == Description == 9 BaseObject is a container for9 !BaseObject is a container for 10 10 * The Name of the Object (how the object is called) 11 11 * The Class' Name of the Object (in what class this object is) … … 14 14 == Usage == 15 15 * __Registration__:[[br]] 16 Each class, that extends BaseObject must implement the following function:17 1. In the Class-Declaration use the following syntax (taken your class is named OrxClass)16 Each class, that extends !BaseObject must implement the following function: 17 1. In the Class-Declaration use the following syntax (taken your class is named !OrxClass) 18 18 {{{ 19 19 #!cpp 20 class OrxClass : public BaseObject // here you could also specify any class derived fromBaseObject20 class OrxClass : public !BaseObject // here you could also specify any class derived from !BaseObject 21 21 { 22 22 ObjectListDeclaration(OrxClass); … … 29 29 ObjectListDefinition(OrxClass); 30 30 }}} 31 1. In the constructor of each class implementing BaseObject write the following:31 1. In the constructor of each class implementing !BaseObject write the following: 32 32 {{{ 33 33 #!cpp … … 40 40 }}} 41 41 * __isA__:[[br]] 42 isA is a function, that queries, if the Object is of a Specified type. e.g. given a class Player that is derived from BaseObject and [wiki:ParentNode PNode] one can do the following check :42 isA is a function, that queries, if the Object is of a Specified type. e.g. given a class Player that is derived from !BaseObject and [wiki:archive/ParentNode PNode] one can do the following check : 43 43 {{{ 44 44 #!cpp … … 49 49 50 50 == Advanced Topics == 51 An interessting Function, that BaseObject provides is the ObjectList.52 With it, one can retrieve lists of any one kind of derived classes from BaseObject.51 An interessting Function, that !BaseObject provides is the [wiki:archive/ObjectList ObjectList]. 52 With it, one can retrieve lists of any one kind of derived classes from !BaseObject.