Changes between Version 3 and Version 4 of code/howto/ClassHierarchy
- Timestamp:
- Apr 12, 2017, 11:44:25 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/howto/ClassHierarchy
v3 v4 1 1 = HowTo: Adding a new class to the hierarchy = 2 [[TracNav(TracNav/TOC_Development)]]3 2 [[TOC]] 4 3 5 The class hierarchy in Orxonox is controlled by [wiki: Identifier Identifiers]. Every class has it's identifier. This page explains how a new class is added correctly to the class hierarchy.4 The class hierarchy in Orxonox is controlled by [wiki:doc/Identifier Identifiers]. Every class has it's identifier. This page explains how a new class is added correctly to the class hierarchy. 6 5 7 6 Features available to classes in the hierarchy: 8 7 * [wiki:howto/Identifier Identifier] 9 * [wiki: Factory Factory]8 * [wiki:doc/Factory Factory] 10 9 * [wiki:howto/Iterator ObjectLists] 11 10 * [wiki:howto/ConfigValue Config-Values] … … 14 13 15 14 == Objects == 16 If you want to create a new object (an object in the sense of a game-related class), you have to inherit directly or indirectly from [wiki: BaseObject] and call '''RegisterObject('''''ClassName''''')''' (see [wiki:CoreIncludes]) in the constructor of this class.15 If you want to create a new object (an object in the sense of a game-related class), you have to inherit directly or indirectly from [wiki:doc/BaseObject] and call '''RegisterObject('''''ClassName''''')''' (see [wiki:doc/CoreIncludes]) in the constructor of this class. 17 16 18 If you want this class to be [wiki: Loader loadable] from an [wiki:XMLPort XML-file], add '''CreateFactory('''''ClassName''''')''' outside of the code. This creates a mapping between the string "ClassName" and the class itself (see [wiki:Factory]).17 If you want this class to be [wiki:doc/Loader loadable] from an [wiki:doc/XMLPort XML-file], add '''CreateFactory('''''ClassName''''')''' outside of the code. This creates a mapping between the string "ClassName" and the class itself (see [wiki:doc/Factory]). 19 18 20 19 *.h file: … … 53 52 54 53 == Interfaces == 55 Interfaces in Orxonox aren't objects by themselfes, but provide functions and features for real objects. Those objects inherit from the interfaces, additionally to [wiki: BaseObject] (or a derivative).54 Interfaces in Orxonox aren't objects by themselfes, but provide functions and features for real objects. Those objects inherit from the interfaces, additionally to [wiki:doc/BaseObject] (or a derivative). 56 55 57 Interfaces have to inherit virtually from [wiki: OrxonoxClass] and call '''RegisterRootObject('''''InterfaceName''''')''' in the constructor.56 Interfaces have to inherit virtually from [wiki:doc/OrxonoxClass] and call '''RegisterRootObject('''''InterfaceName''''')''' in the constructor. 58 57 59 58 *.h file: