class MethodReg
Defined in: C4Methods.h
The MethodReg class represents a custom script method type.
Definition
template <class classType> class MethodReg : public MethodRegistration
Template Parameters
classType |
The custom method class.
|
Constructor
MethodReg(MethodType type, const char *name, unsigned long flags = 0, MethodGroup group = 0);
Parameters
type |
The method type.
|
name |
The method name.
|
flags |
The method flags. See below for possible values.
|
group |
The group to which the method belongs. This should be 0 for all custom methods.
|
Description
The MethodReg template class is used to advertise the existence of a custom script method type. The World Manager uses a method registration to construct a custom method, and the Script Editor displays a list of registered methods. The act of instantiating a MethodReg object automatically registers the corresponding method type. The method type is unregistered when the MethodReg object is destroyed.
The flags parameter specifies special properties of the method type and can be a combination (through logical OR) of the following values.
kMethodNoTarget |
The method does not operate on a target node.
|
kMethodNoSelfTarget |
The method cannot operate on the node to which its script controller is attached.
|
kMethodNoMessage |
The method does not generate any controller messages. This flag is implied by kMethodNoTarget.
|
kMethodOutputValue |
The method generates an output value that can be stored in a script variable.
|
No more than one method registration should be created for each distinct method type.
Base Classes
MethodRegistration |
All specific method registration classes share the common base class MethodRegistration.
|
See Also
Method
|