C4 Engine
C4 Engine API Documentation

class ForceReg

Defined in:  C4Forces.h
The ForceReg class represents a custom force type.
Definition

template <class classType> class ForceReg : public ForceRegistration

Template Parameters
classType The custom force class.
Constructor

ForceReg(ForceType type, const char *name);

Parameters
type The force type.
name The force name.
Description
The ForceReg template class is used to advertise the existence of a custom force type. The World Manager uses a force registration to construct a custom force, and the World Editor examines a force registration to determine what type of field a custom force can be assigned to. The act of instantiating a ForceReg object automatically registers the corresponding force type. The force type is unregistered when the ForceReg object is destroyed.

No more than one force registration should be created for each distinct force type.
Base Classes
ForceRegistration All specific force registration classes share the common base class ForceRegistration.
See Also

Force