namespace NT { /**
     * Manages behaviors in the system.
     */ export class BehaviorManager { private static _registeredBuilders : { [ type ] : IBehaviorBuilder ; } = { } ; param builder public static registerBuilder ( builder ) { BehaviorManager . _registeredBuilders [ builder . type ] = builder ; } param json public static extractBehavior ( json ) { if ( json . type !== undefined ) { if ( BehaviorManager . _registeredBuilders [ String ( json . type ) ] !== undefined ) { return BehaviorManager . _registeredBuilders [ String ( json . type ) ] . buildFromJson ( json ) ; } throw new Error ( "Behavior manager error - type is missing or builder is not registered for this type." ) ; } } } }