C4 Engine
C4 Engine API Documentation

Node::AddProperty

Defined in:  C4Node.h
Attaches a property to a node.
Prototype

bool AddProperty(Property *property);

Parameters
property The property to attach.
Description
The AddProperty function attaches the property specified by the property parameter directly to a node. A property can be attached to only one node at a time, so the property is first removed from any other node to which it may have previously been attached.

Only one property of any particular type can be attached to a node at one time. If the node has no property having the same type as the property specified by the property parameter, then the return value is true. If a property having the same type is already attached to the node, then no action is taken and the AddProperty function returns false. In the case, the property is not removed from any node to which it may have previously been attached.
See Also

Node::GetFirstProperty

Node::GetProperty

Property