C4 Engine
C4 Engine API Documentation

class Property

Defined in:  C4Properties.h
Every property that can be attached to a scene graph node is a subclass of the Property class.
Definition

class Property : public MapElement<Property>, public Packable, public Configurable, public Registrable<Property, PropertyRegistration>

Member Functions
Property::GetPropertyType Returns the property type.
Property::GetPropertyFlags Returns the property flags.
Property::SetPropertyFlags Returns the property flags.
Property::ValidNode Returns a boolean value indicating whether a property can be assigned to a particular node.
Property::SharedProperty Returns a boolean value indicating whether a property is supposed to be shared.
Constructor

Property(PropertyType type);

Parameters
type The property type.
Description
The Property class is a generic container for any kind of special information that can be attached to a scene graph node. An application may define its own custom properties, and they become visible in the World Editor.

A custom property type is usually defined by creating a subclass of the Property class. For the property type to be visible in the World Editor, it is also necessary to construct an associated PropertyReg object. Although a subclass is normally created for custom property types, using the base class alone is allowed if the property does not need to carry any information beyond its type. (It may be sufficient for the application to simply detect that a particular type of property exists for a node.) In this case, the custom property type still needs to be registered using the PropertyReg template, but the classType template parameter may simply be Property.

A custom property can expose its data to the World Editor by implementing the functions of the Configurable base class.
Base Classes
MapElement<Property> Properties are stored in a map.
Packable Properties can be packed for storage in resources.
Configurable Properties can define configurable parameters that are exposed as user interface widgets in the World Editor.
Registrable<Property, PropertyRegistration> Custom property types can be registered with the engine.
See Also

Node::GetFirstProperty

Node::GetProperty

Node::AddProperty

PropertyObject

PropertyReg