registerType method

StateMachine registerType(
  1. String type,
  2. Function constructor
)

Registers a custom type for deserialization. When calling {@link StateMachine#fromJSON} the state machine is able to pick the correct constructor in order to create custom states.

Implementation

StateMachine registerType( String type, Function constructor ) {
	_typesMap[type] = constructor;
	return this;
}