f963977e2197e3e60da49e3481316a7d2045315ed47f2c29f31a57b9a3da31f9.json 5.4 KB

1
  1. {"ast":null,"code":"import { RichTypeBoolean } from \"../../../flowGraphRichTypes.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal.js\";\n/**\n * @experimental\n * A block that executes a branch while a condition is true.\n */\nexport class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\n constructor(\n /**\n * the configuration of the block\n */\n config) {\n super(config);\n this.config = config;\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\n this.loopBody = this._registerSignalOutput(\"loopBody\");\n }\n _execute(context, _callingSignal) {\n var _this$config;\n let conditionValue = this.condition.getValue(context);\n if ((_this$config = this.config) !== null && _this$config !== void 0 && _this$config.isDo && !conditionValue) {\n this.loopBody._activateSignal(context);\n }\n while (conditionValue) {\n this.loopBody._activateSignal(context);\n conditionValue = this.condition.getValue(context);\n }\n this.out._activateSignal(context);\n }\n /**\n * @returns class name of the block.\n */\n getClassName() {\n return FlowGraphWhileLoopBlock.ClassName;\n }\n /**\n * Serializes the block to a JSON object.\n * @param serializationObject the object to serialize to.\n */\n serialize(serializationObject) {\n var _this$config2;\n super.serialize(serializationObject);\n serializationObject.isDo = (_this$config2 = this.config) === null || _this$config2 === void 0 ? void 0 : _this$config2.isDo;\n }\n}\n/**\n * the class name of the block.\n */\nFlowGraphWhileLoopBlock.ClassName = \"FGWhileLoopBlock\";\nRegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);","map":{"version":3,"names":["RichTypeBoolean","RegisterClass","FlowGraphExecutionBlockWithOutSignal","FlowGraphWhileLoopBlock","constructor","config","condition","registerDataInput","loopBody","_registerSignalOutput","_execute","context","_callingSignal","_this$config","conditionValue","getValue","isDo","_activateSignal","out","getClassName","ClassName","serialize","serializationObject","_this$config2"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js"],"sourcesContent":["import { RichTypeBoolean } from \"../../../flowGraphRichTypes.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal.js\";\n/**\n * @experimental\n * A block that executes a branch while a condition is true.\n */\nexport class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\n constructor(\n /**\n * the configuration of the block\n */\n config) {\n super(config);\n this.config = config;\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\n this.loopBody = this._registerSignalOutput(\"loopBody\");\n }\n _execute(context, _callingSignal) {\n let conditionValue = this.condition.getValue(context);\n if (this.config?.isDo && !conditionValue) {\n this.loopBody._activateSignal(context);\n }\n while (conditionValue) {\n this.loopBody._activateSignal(context);\n conditionValue = this.condition.getValue(context);\n }\n this.out._activateSignal(context);\n }\n /**\n * @returns class name of the block.\n */\n getClassName() {\n return FlowGraphWhileLoopBlock.ClassName;\n }\n /**\n * Serializes the block to a JSON object.\n * @param serializationObject the object to serialize to.\n */\n serialize(serializationObject) {\n super.serialize(serializationObject);\n serializationObject.isDo = this.config?.isDo;\n }\n}\n/**\n * the class name of the block.\n */\nFlowGraphWhileLoopBlock.ClassName = \"FGWhileLoopBlock\";\nRegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,gCAAgC;AAChE,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,oCAAoC,QAAQ,kDAAkD;AACvG;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,SAASD,oCAAoC,CAAC;EAC9EE,WAAWA;EACX;AACJ;AACA;EACIC,MAAM,EAAE;IACJ,KAAK,CAACA,MAAM,CAAC;IACb,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SA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