DebugProtectionNodesGroup.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { IOptions } from "../interfaces/IOptions";
  2. import { DebugProtectionFunctionCallNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode";
  3. import { DebugProtectionFunctionIntervalNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode";
  4. import { DebugProtectionFunctionNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode";
  5. import { NodesGroup } from './NodesGroup';
  6. import { Utils } from '../Utils';
  7. export class DebugProtectionNodesGroup extends NodesGroup {
  8. /**
  9. * @type {string}
  10. */
  11. private debugProtectionFunctionIdentifier: string = Utils.getRandomVariableName();
  12. /**
  13. * @param options
  14. */
  15. constructor (options: IOptions = {}) {
  16. super(options);
  17. this.nodes.set(
  18. 'debugProtectionFunctionNode',
  19. new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier, this.options)
  20. );
  21. this.nodes.set(
  22. 'debugProtectionFunctionCallNode',
  23. new DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier, this.options)
  24. );
  25. if (this.options['debugProtectionInterval']) {
  26. this.nodes.set(
  27. 'debugProtectionFunctionIntervalNode',
  28. new DebugProtectionFunctionIntervalNode(this.debugProtectionFunctionIdentifier, this.options)
  29. );
  30. }
  31. }
  32. }