Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 2 (modified by landauf, 17 years ago) (diff)

Core includes

Description

CoreIncludes.h is a header-file, declaring several easy-to-use macros providing functionalities of the core library like Identifiers, the Factory, config-values and others.

Macros

  • Identifier:
    • RegisterObject(ClassName): This macro is used by classes that want to have an Identifier. Use the macro at the beginning of the constructor. It adds new objects of this class to the corresponding ObjectList and helps building up the class hierarchy.
    • RegisterRootObject(ClassName): This is the same as RegisterObject(ClassName), but for root-classes like Interfaces (Tickable, Synchronisable? and others) and the BaseObject.
    • Class(ClassName): Returns the ClassIdentifier of the given class.
  • Factory:
    • CreateFactory(ClassName): Creates the entry in the Factory for the given class and adds a ClassFactory to the corresponding Identifier.
    • ID(StringOrInt): Returns the Identifier of the class with the given name or the given network ID if the entry in the Factory exists (see CreateFactory(ClassName)).
  • Config-values:
    • SetConfigValue(varname, defvalue): Defines a configurable variable with a default-value that can be changed in the config-file.
    • ResetConfigValue(varname): Sets the given config-value back to the default-value (see SetConfigValue(varname, defvalue)).