UnicodeArrayNodesGroup.js 1.8 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. const NodesGroup_1 = require('./NodesGroup');
  3. const UnicodeArrayCallsWrapper_1 = require("../custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper");
  4. const UnicodeArrayNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayNode');
  5. const UnicodeArrayRotateFunctionNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode');
  6. const Utils_1 = require('../Utils');
  7. class UnicodeArrayNodesGroup extends NodesGroup_1.NodesGroup {
  8. constructor(options) {
  9. super();
  10. this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  11. this.unicodeArrayRotateValue = Utils_1.Utils.getRandomInteger(100, 500);
  12. this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  13. this.options = options;
  14. let unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(this.unicodeArrayName, this.unicodeArrayRotateValue), unicodeArray = unicodeArrayNode.getNodeData();
  15. this.nodes = new Map([
  16. [
  17. 'unicodeArrayNode',
  18. unicodeArrayNode
  19. ]
  20. ]);
  21. if (this.options['wrapUnicodeArrayCalls']) {
  22. this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(this.unicodeArrayTranslatorName, this.unicodeArrayName, unicodeArray));
  23. }
  24. if (this.options['rotateUnicodeArray']) {
  25. this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(this.unicodeArrayName, unicodeArray, this.unicodeArrayRotateValue));
  26. }
  27. }
  28. }
  29. exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;