e169eccff8e55540099f83e05081a203c04574024dd5949d70ecac67043632fa.json 5.1 KB

1
  1. {"ast":null,"code":"import { RichTypeFlowGraphInteger } from \"../../../flowGraphRichTypes.js\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { FlowGraphInteger } from \"../../../flowGraphInteger.js\";\n/**\n * A block that executes a branch a set number of times.\n * @experimental\n */\nexport class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {\n constructor(\n /**\n * [Object] the configuration of the block\n */\n config = {\n startIndex: new FlowGraphInteger(0)\n }) {\n super(config);\n this.config = config;\n this.reset = this._registerSignalInput(\"reset\");\n this.n = this.registerDataInput(\"n\", RichTypeFlowGraphInteger);\n this.value = this.registerDataOutput(\"value\", RichTypeFlowGraphInteger);\n }\n _execute(context, callingSignal) {\n if (callingSignal === this.reset) {\n this.value.setValue(this.config.startIndex, context);\n } else {\n const currentCountValue = this.value.getValue(context);\n if (currentCountValue.value < this.n.getValue(context).value) {\n this.value.setValue(new FlowGraphInteger(currentCountValue.value + 1), context);\n this.out._activateSignal(context);\n }\n }\n }\n /**\n * @returns class name of the block.\n */\n getClassName() {\n return FlowGraphDoNBlock.ClassName;\n }\n}\n/**\n * the class name of the block.\n */\nFlowGraphDoNBlock.ClassName = \"FGDoNBlock\";\nRegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);","map":{"version":3,"names":["RichTypeFlowGraphInteger","FlowGraphExecutionBlockWithOutSignal","RegisterClass","FlowGraphInteger","FlowGraphDoNBlock","constructor","config","startIndex","reset","_registerSignalInput","n","registerDataInput","value","registerDataOutput","_execute","context","callingSignal","setValue","currentCountValue","getValue","out","_activateSignal","getClassName","ClassName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js"],"sourcesContent":["import { RichTypeFlowGraphInteger } from \"../../../flowGraphRichTypes.js\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { FlowGraphInteger } from \"../../../flowGraphInteger.js\";\n/**\n * A block that executes a branch a set number of times.\n * @experimental\n */\nexport class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {\n constructor(\n /**\n * [Object] the configuration of the block\n */\n config = { startIndex: new FlowGraphInteger(0) }) {\n super(config);\n this.config = config;\n this.reset = this._registerSignalInput(\"reset\");\n this.n = this.registerDataInput(\"n\", RichTypeFlowGraphInteger);\n this.value = this.registerDataOutput(\"value\", RichTypeFlowGraphInteger);\n }\n _execute(context, callingSignal) {\n if (callingSignal === this.reset) {\n this.value.setValue(this.config.startIndex, context);\n }\n else {\n const currentCountValue = this.value.getValue(context);\n if (currentCountValue.value < this.n.getValue(context).value) {\n this.value.setValue(new FlowGraphInteger(currentCountValue.value + 1), context);\n this.out._activateSignal(context);\n }\n }\n }\n /**\n * @returns class name of the block.\n */\n getClassName() {\n return FlowGraphDoNBlock.ClassName;\n }\n}\n/**\n * the class name of the block.\n */\nFlowGraphDoNBlock.ClassName = \"FGDoNBlock\";\nRegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,oCAAoC,QAAQ,kDAAkD;AACvG,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SAASH,oCAAoC,CAAC;EACxEI,WAAWA;EACX;AACJ;AACA;EACIC,MAAM,GAAG;IAAEC,UAAU,EAAE,IAAIJ,gBAAgB,CAAC,CAAC;EAAE,CAAC,EAAE;IAC9C,KAAK,CAACG,MAAM,CAAC;IACb,IAAI,CAACA,MAAM,GAAGA,MAAM;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