@esengine/blueprint 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1920 -108
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4852,7 +4852,7 @@ WhileLoopExecutor = _ts_decorate8([
|
|
|
4852
4852
|
RegisterNode(WhileLoopTemplate)
|
|
4853
4853
|
], WhileLoopExecutor);
|
|
4854
4854
|
|
|
4855
|
-
// src/nodes/
|
|
4855
|
+
// src/nodes/variables/VariableNodes.ts
|
|
4856
4856
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
4857
4857
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4858
4858
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4860,6 +4860,342 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
4860
4860
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4861
4861
|
}
|
|
4862
4862
|
__name(_ts_decorate9, "_ts_decorate");
|
|
4863
|
+
var GetVariableTemplate = {
|
|
4864
|
+
type: "GetVariable",
|
|
4865
|
+
title: "Get Variable",
|
|
4866
|
+
category: "variable",
|
|
4867
|
+
color: "#4a9c6d",
|
|
4868
|
+
isPure: true,
|
|
4869
|
+
description: "Gets the value of a variable (\u83B7\u53D6\u53D8\u91CF\u7684\u503C)",
|
|
4870
|
+
keywords: [
|
|
4871
|
+
"variable",
|
|
4872
|
+
"get",
|
|
4873
|
+
"read",
|
|
4874
|
+
"value"
|
|
4875
|
+
],
|
|
4876
|
+
menuPath: [
|
|
4877
|
+
"Variable",
|
|
4878
|
+
"Get Variable"
|
|
4879
|
+
],
|
|
4880
|
+
inputs: [
|
|
4881
|
+
{
|
|
4882
|
+
name: "variableName",
|
|
4883
|
+
type: "string",
|
|
4884
|
+
displayName: "Variable Name",
|
|
4885
|
+
defaultValue: ""
|
|
4886
|
+
}
|
|
4887
|
+
],
|
|
4888
|
+
outputs: [
|
|
4889
|
+
{
|
|
4890
|
+
name: "value",
|
|
4891
|
+
type: "any",
|
|
4892
|
+
displayName: "Value"
|
|
4893
|
+
}
|
|
4894
|
+
]
|
|
4895
|
+
};
|
|
4896
|
+
var _GetVariableExecutor = class _GetVariableExecutor {
|
|
4897
|
+
execute(node, context) {
|
|
4898
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
4899
|
+
if (!variableName) {
|
|
4900
|
+
return {
|
|
4901
|
+
outputs: {
|
|
4902
|
+
value: null
|
|
4903
|
+
}
|
|
4904
|
+
};
|
|
4905
|
+
}
|
|
4906
|
+
const value = context.getVariable(variableName);
|
|
4907
|
+
return {
|
|
4908
|
+
outputs: {
|
|
4909
|
+
value
|
|
4910
|
+
}
|
|
4911
|
+
};
|
|
4912
|
+
}
|
|
4913
|
+
};
|
|
4914
|
+
__name(_GetVariableExecutor, "GetVariableExecutor");
|
|
4915
|
+
var GetVariableExecutor = _GetVariableExecutor;
|
|
4916
|
+
GetVariableExecutor = _ts_decorate9([
|
|
4917
|
+
RegisterNode(GetVariableTemplate)
|
|
4918
|
+
], GetVariableExecutor);
|
|
4919
|
+
var SetVariableTemplate = {
|
|
4920
|
+
type: "SetVariable",
|
|
4921
|
+
title: "Set Variable",
|
|
4922
|
+
category: "variable",
|
|
4923
|
+
color: "#4a9c6d",
|
|
4924
|
+
description: "Sets the value of a variable (\u8BBE\u7F6E\u53D8\u91CF\u7684\u503C)",
|
|
4925
|
+
keywords: [
|
|
4926
|
+
"variable",
|
|
4927
|
+
"set",
|
|
4928
|
+
"write",
|
|
4929
|
+
"assign",
|
|
4930
|
+
"value"
|
|
4931
|
+
],
|
|
4932
|
+
menuPath: [
|
|
4933
|
+
"Variable",
|
|
4934
|
+
"Set Variable"
|
|
4935
|
+
],
|
|
4936
|
+
inputs: [
|
|
4937
|
+
{
|
|
4938
|
+
name: "exec",
|
|
4939
|
+
type: "exec",
|
|
4940
|
+
displayName: ""
|
|
4941
|
+
},
|
|
4942
|
+
{
|
|
4943
|
+
name: "variableName",
|
|
4944
|
+
type: "string",
|
|
4945
|
+
displayName: "Variable Name",
|
|
4946
|
+
defaultValue: ""
|
|
4947
|
+
},
|
|
4948
|
+
{
|
|
4949
|
+
name: "value",
|
|
4950
|
+
type: "any",
|
|
4951
|
+
displayName: "Value"
|
|
4952
|
+
}
|
|
4953
|
+
],
|
|
4954
|
+
outputs: [
|
|
4955
|
+
{
|
|
4956
|
+
name: "exec",
|
|
4957
|
+
type: "exec",
|
|
4958
|
+
displayName: ""
|
|
4959
|
+
},
|
|
4960
|
+
{
|
|
4961
|
+
name: "value",
|
|
4962
|
+
type: "any",
|
|
4963
|
+
displayName: "Value"
|
|
4964
|
+
}
|
|
4965
|
+
]
|
|
4966
|
+
};
|
|
4967
|
+
var _SetVariableExecutor = class _SetVariableExecutor {
|
|
4968
|
+
execute(node, context) {
|
|
4969
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
4970
|
+
const value = context.evaluateInput(node.id, "value", null);
|
|
4971
|
+
if (!variableName) {
|
|
4972
|
+
return {
|
|
4973
|
+
outputs: {
|
|
4974
|
+
value: null
|
|
4975
|
+
},
|
|
4976
|
+
nextExec: "exec"
|
|
4977
|
+
};
|
|
4978
|
+
}
|
|
4979
|
+
context.setVariable(variableName, value);
|
|
4980
|
+
return {
|
|
4981
|
+
outputs: {
|
|
4982
|
+
value
|
|
4983
|
+
},
|
|
4984
|
+
nextExec: "exec"
|
|
4985
|
+
};
|
|
4986
|
+
}
|
|
4987
|
+
};
|
|
4988
|
+
__name(_SetVariableExecutor, "SetVariableExecutor");
|
|
4989
|
+
var SetVariableExecutor = _SetVariableExecutor;
|
|
4990
|
+
SetVariableExecutor = _ts_decorate9([
|
|
4991
|
+
RegisterNode(SetVariableTemplate)
|
|
4992
|
+
], SetVariableExecutor);
|
|
4993
|
+
var GetBoolVariableTemplate = {
|
|
4994
|
+
type: "GetBoolVariable",
|
|
4995
|
+
title: "Get Bool",
|
|
4996
|
+
category: "variable",
|
|
4997
|
+
color: "#8b1e3f",
|
|
4998
|
+
isPure: true,
|
|
4999
|
+
description: "Gets a boolean variable (\u83B7\u53D6\u5E03\u5C14\u53D8\u91CF)",
|
|
5000
|
+
keywords: [
|
|
5001
|
+
"variable",
|
|
5002
|
+
"get",
|
|
5003
|
+
"bool",
|
|
5004
|
+
"boolean"
|
|
5005
|
+
],
|
|
5006
|
+
menuPath: [
|
|
5007
|
+
"Variable",
|
|
5008
|
+
"Get Bool"
|
|
5009
|
+
],
|
|
5010
|
+
inputs: [
|
|
5011
|
+
{
|
|
5012
|
+
name: "variableName",
|
|
5013
|
+
type: "string",
|
|
5014
|
+
displayName: "Variable Name",
|
|
5015
|
+
defaultValue: ""
|
|
5016
|
+
}
|
|
5017
|
+
],
|
|
5018
|
+
outputs: [
|
|
5019
|
+
{
|
|
5020
|
+
name: "value",
|
|
5021
|
+
type: "bool",
|
|
5022
|
+
displayName: "Value"
|
|
5023
|
+
}
|
|
5024
|
+
]
|
|
5025
|
+
};
|
|
5026
|
+
var _GetBoolVariableExecutor = class _GetBoolVariableExecutor {
|
|
5027
|
+
execute(node, context) {
|
|
5028
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
5029
|
+
const value = context.getVariable(variableName);
|
|
5030
|
+
return {
|
|
5031
|
+
outputs: {
|
|
5032
|
+
value: Boolean(value)
|
|
5033
|
+
}
|
|
5034
|
+
};
|
|
5035
|
+
}
|
|
5036
|
+
};
|
|
5037
|
+
__name(_GetBoolVariableExecutor, "GetBoolVariableExecutor");
|
|
5038
|
+
var GetBoolVariableExecutor = _GetBoolVariableExecutor;
|
|
5039
|
+
GetBoolVariableExecutor = _ts_decorate9([
|
|
5040
|
+
RegisterNode(GetBoolVariableTemplate)
|
|
5041
|
+
], GetBoolVariableExecutor);
|
|
5042
|
+
var GetFloatVariableTemplate = {
|
|
5043
|
+
type: "GetFloatVariable",
|
|
5044
|
+
title: "Get Float",
|
|
5045
|
+
category: "variable",
|
|
5046
|
+
color: "#39c5bb",
|
|
5047
|
+
isPure: true,
|
|
5048
|
+
description: "Gets a float variable (\u83B7\u53D6\u6D6E\u70B9\u53D8\u91CF)",
|
|
5049
|
+
keywords: [
|
|
5050
|
+
"variable",
|
|
5051
|
+
"get",
|
|
5052
|
+
"float",
|
|
5053
|
+
"number"
|
|
5054
|
+
],
|
|
5055
|
+
menuPath: [
|
|
5056
|
+
"Variable",
|
|
5057
|
+
"Get Float"
|
|
5058
|
+
],
|
|
5059
|
+
inputs: [
|
|
5060
|
+
{
|
|
5061
|
+
name: "variableName",
|
|
5062
|
+
type: "string",
|
|
5063
|
+
displayName: "Variable Name",
|
|
5064
|
+
defaultValue: ""
|
|
5065
|
+
}
|
|
5066
|
+
],
|
|
5067
|
+
outputs: [
|
|
5068
|
+
{
|
|
5069
|
+
name: "value",
|
|
5070
|
+
type: "float",
|
|
5071
|
+
displayName: "Value"
|
|
5072
|
+
}
|
|
5073
|
+
]
|
|
5074
|
+
};
|
|
5075
|
+
var _GetFloatVariableExecutor = class _GetFloatVariableExecutor {
|
|
5076
|
+
execute(node, context) {
|
|
5077
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
5078
|
+
const value = context.getVariable(variableName);
|
|
5079
|
+
return {
|
|
5080
|
+
outputs: {
|
|
5081
|
+
value: Number(value) || 0
|
|
5082
|
+
}
|
|
5083
|
+
};
|
|
5084
|
+
}
|
|
5085
|
+
};
|
|
5086
|
+
__name(_GetFloatVariableExecutor, "GetFloatVariableExecutor");
|
|
5087
|
+
var GetFloatVariableExecutor = _GetFloatVariableExecutor;
|
|
5088
|
+
GetFloatVariableExecutor = _ts_decorate9([
|
|
5089
|
+
RegisterNode(GetFloatVariableTemplate)
|
|
5090
|
+
], GetFloatVariableExecutor);
|
|
5091
|
+
var GetIntVariableTemplate = {
|
|
5092
|
+
type: "GetIntVariable",
|
|
5093
|
+
title: "Get Int",
|
|
5094
|
+
category: "variable",
|
|
5095
|
+
color: "#1c8b8b",
|
|
5096
|
+
isPure: true,
|
|
5097
|
+
description: "Gets an integer variable (\u83B7\u53D6\u6574\u6570\u53D8\u91CF)",
|
|
5098
|
+
keywords: [
|
|
5099
|
+
"variable",
|
|
5100
|
+
"get",
|
|
5101
|
+
"int",
|
|
5102
|
+
"integer",
|
|
5103
|
+
"number"
|
|
5104
|
+
],
|
|
5105
|
+
menuPath: [
|
|
5106
|
+
"Variable",
|
|
5107
|
+
"Get Int"
|
|
5108
|
+
],
|
|
5109
|
+
inputs: [
|
|
5110
|
+
{
|
|
5111
|
+
name: "variableName",
|
|
5112
|
+
type: "string",
|
|
5113
|
+
displayName: "Variable Name",
|
|
5114
|
+
defaultValue: ""
|
|
5115
|
+
}
|
|
5116
|
+
],
|
|
5117
|
+
outputs: [
|
|
5118
|
+
{
|
|
5119
|
+
name: "value",
|
|
5120
|
+
type: "int",
|
|
5121
|
+
displayName: "Value"
|
|
5122
|
+
}
|
|
5123
|
+
]
|
|
5124
|
+
};
|
|
5125
|
+
var _GetIntVariableExecutor = class _GetIntVariableExecutor {
|
|
5126
|
+
execute(node, context) {
|
|
5127
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
5128
|
+
const value = context.getVariable(variableName);
|
|
5129
|
+
return {
|
|
5130
|
+
outputs: {
|
|
5131
|
+
value: Math.floor(Number(value) || 0)
|
|
5132
|
+
}
|
|
5133
|
+
};
|
|
5134
|
+
}
|
|
5135
|
+
};
|
|
5136
|
+
__name(_GetIntVariableExecutor, "GetIntVariableExecutor");
|
|
5137
|
+
var GetIntVariableExecutor = _GetIntVariableExecutor;
|
|
5138
|
+
GetIntVariableExecutor = _ts_decorate9([
|
|
5139
|
+
RegisterNode(GetIntVariableTemplate)
|
|
5140
|
+
], GetIntVariableExecutor);
|
|
5141
|
+
var GetStringVariableTemplate = {
|
|
5142
|
+
type: "GetStringVariable",
|
|
5143
|
+
title: "Get String",
|
|
5144
|
+
category: "variable",
|
|
5145
|
+
color: "#e91e8c",
|
|
5146
|
+
isPure: true,
|
|
5147
|
+
description: "Gets a string variable (\u83B7\u53D6\u5B57\u7B26\u4E32\u53D8\u91CF)",
|
|
5148
|
+
keywords: [
|
|
5149
|
+
"variable",
|
|
5150
|
+
"get",
|
|
5151
|
+
"string",
|
|
5152
|
+
"text"
|
|
5153
|
+
],
|
|
5154
|
+
menuPath: [
|
|
5155
|
+
"Variable",
|
|
5156
|
+
"Get String"
|
|
5157
|
+
],
|
|
5158
|
+
inputs: [
|
|
5159
|
+
{
|
|
5160
|
+
name: "variableName",
|
|
5161
|
+
type: "string",
|
|
5162
|
+
displayName: "Variable Name",
|
|
5163
|
+
defaultValue: ""
|
|
5164
|
+
}
|
|
5165
|
+
],
|
|
5166
|
+
outputs: [
|
|
5167
|
+
{
|
|
5168
|
+
name: "value",
|
|
5169
|
+
type: "string",
|
|
5170
|
+
displayName: "Value"
|
|
5171
|
+
}
|
|
5172
|
+
]
|
|
5173
|
+
};
|
|
5174
|
+
var _GetStringVariableExecutor = class _GetStringVariableExecutor {
|
|
5175
|
+
execute(node, context) {
|
|
5176
|
+
const variableName = context.evaluateInput(node.id, "variableName", "");
|
|
5177
|
+
const value = context.getVariable(variableName);
|
|
5178
|
+
return {
|
|
5179
|
+
outputs: {
|
|
5180
|
+
value: String(value ?? "")
|
|
5181
|
+
}
|
|
5182
|
+
};
|
|
5183
|
+
}
|
|
5184
|
+
};
|
|
5185
|
+
__name(_GetStringVariableExecutor, "GetStringVariableExecutor");
|
|
5186
|
+
var GetStringVariableExecutor = _GetStringVariableExecutor;
|
|
5187
|
+
GetStringVariableExecutor = _ts_decorate9([
|
|
5188
|
+
RegisterNode(GetStringVariableTemplate)
|
|
5189
|
+
], GetStringVariableExecutor);
|
|
5190
|
+
|
|
5191
|
+
// src/nodes/math/MathOperations.ts
|
|
5192
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
5193
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5194
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5195
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5196
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5197
|
+
}
|
|
5198
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
4863
5199
|
var AddTemplate = {
|
|
4864
5200
|
type: "Add",
|
|
4865
5201
|
title: "Add",
|
|
@@ -4867,219 +5203,1695 @@ var AddTemplate = {
|
|
|
4867
5203
|
color: "#4CAF50",
|
|
4868
5204
|
description: "Adds two numbers together (\u5C06\u4E24\u4E2A\u6570\u5B57\u76F8\u52A0)",
|
|
4869
5205
|
keywords: [
|
|
4870
|
-
"add",
|
|
4871
|
-
"plus",
|
|
4872
|
-
"sum",
|
|
4873
|
-
"+",
|
|
4874
|
-
"math"
|
|
5206
|
+
"add",
|
|
5207
|
+
"plus",
|
|
5208
|
+
"sum",
|
|
5209
|
+
"+",
|
|
5210
|
+
"math"
|
|
5211
|
+
],
|
|
5212
|
+
isPure: true,
|
|
5213
|
+
inputs: [
|
|
5214
|
+
{
|
|
5215
|
+
name: "a",
|
|
5216
|
+
type: "float",
|
|
5217
|
+
displayName: "A",
|
|
5218
|
+
defaultValue: 0
|
|
5219
|
+
},
|
|
5220
|
+
{
|
|
5221
|
+
name: "b",
|
|
5222
|
+
type: "float",
|
|
5223
|
+
displayName: "B",
|
|
5224
|
+
defaultValue: 0
|
|
5225
|
+
}
|
|
5226
|
+
],
|
|
5227
|
+
outputs: [
|
|
5228
|
+
{
|
|
5229
|
+
name: "result",
|
|
5230
|
+
type: "float",
|
|
5231
|
+
displayName: "Result"
|
|
5232
|
+
}
|
|
5233
|
+
]
|
|
5234
|
+
};
|
|
5235
|
+
var _AddExecutor = class _AddExecutor {
|
|
5236
|
+
execute(node, context) {
|
|
5237
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5238
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
5239
|
+
return {
|
|
5240
|
+
outputs: {
|
|
5241
|
+
result: a + b
|
|
5242
|
+
}
|
|
5243
|
+
};
|
|
5244
|
+
}
|
|
5245
|
+
};
|
|
5246
|
+
__name(_AddExecutor, "AddExecutor");
|
|
5247
|
+
var AddExecutor = _AddExecutor;
|
|
5248
|
+
AddExecutor = _ts_decorate10([
|
|
5249
|
+
RegisterNode(AddTemplate)
|
|
5250
|
+
], AddExecutor);
|
|
5251
|
+
var SubtractTemplate = {
|
|
5252
|
+
type: "Subtract",
|
|
5253
|
+
title: "Subtract",
|
|
5254
|
+
category: "math",
|
|
5255
|
+
color: "#4CAF50",
|
|
5256
|
+
description: "Subtracts B from A (\u4ECE A \u51CF\u53BB B)",
|
|
5257
|
+
keywords: [
|
|
5258
|
+
"subtract",
|
|
5259
|
+
"minus",
|
|
5260
|
+
"-",
|
|
5261
|
+
"math"
|
|
5262
|
+
],
|
|
5263
|
+
isPure: true,
|
|
5264
|
+
inputs: [
|
|
5265
|
+
{
|
|
5266
|
+
name: "a",
|
|
5267
|
+
type: "float",
|
|
5268
|
+
displayName: "A",
|
|
5269
|
+
defaultValue: 0
|
|
5270
|
+
},
|
|
5271
|
+
{
|
|
5272
|
+
name: "b",
|
|
5273
|
+
type: "float",
|
|
5274
|
+
displayName: "B",
|
|
5275
|
+
defaultValue: 0
|
|
5276
|
+
}
|
|
5277
|
+
],
|
|
5278
|
+
outputs: [
|
|
5279
|
+
{
|
|
5280
|
+
name: "result",
|
|
5281
|
+
type: "float",
|
|
5282
|
+
displayName: "Result"
|
|
5283
|
+
}
|
|
5284
|
+
]
|
|
5285
|
+
};
|
|
5286
|
+
var _SubtractExecutor = class _SubtractExecutor {
|
|
5287
|
+
execute(node, context) {
|
|
5288
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5289
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
5290
|
+
return {
|
|
5291
|
+
outputs: {
|
|
5292
|
+
result: a - b
|
|
5293
|
+
}
|
|
5294
|
+
};
|
|
5295
|
+
}
|
|
5296
|
+
};
|
|
5297
|
+
__name(_SubtractExecutor, "SubtractExecutor");
|
|
5298
|
+
var SubtractExecutor = _SubtractExecutor;
|
|
5299
|
+
SubtractExecutor = _ts_decorate10([
|
|
5300
|
+
RegisterNode(SubtractTemplate)
|
|
5301
|
+
], SubtractExecutor);
|
|
5302
|
+
var MultiplyTemplate = {
|
|
5303
|
+
type: "Multiply",
|
|
5304
|
+
title: "Multiply",
|
|
5305
|
+
category: "math",
|
|
5306
|
+
color: "#4CAF50",
|
|
5307
|
+
description: "Multiplies two numbers (\u5C06\u4E24\u4E2A\u6570\u5B57\u76F8\u4E58)",
|
|
5308
|
+
keywords: [
|
|
5309
|
+
"multiply",
|
|
5310
|
+
"times",
|
|
5311
|
+
"*",
|
|
5312
|
+
"math"
|
|
5313
|
+
],
|
|
5314
|
+
isPure: true,
|
|
5315
|
+
inputs: [
|
|
5316
|
+
{
|
|
5317
|
+
name: "a",
|
|
5318
|
+
type: "float",
|
|
5319
|
+
displayName: "A",
|
|
5320
|
+
defaultValue: 0
|
|
5321
|
+
},
|
|
5322
|
+
{
|
|
5323
|
+
name: "b",
|
|
5324
|
+
type: "float",
|
|
5325
|
+
displayName: "B",
|
|
5326
|
+
defaultValue: 1
|
|
5327
|
+
}
|
|
5328
|
+
],
|
|
5329
|
+
outputs: [
|
|
5330
|
+
{
|
|
5331
|
+
name: "result",
|
|
5332
|
+
type: "float",
|
|
5333
|
+
displayName: "Result"
|
|
5334
|
+
}
|
|
5335
|
+
]
|
|
5336
|
+
};
|
|
5337
|
+
var _MultiplyExecutor = class _MultiplyExecutor {
|
|
5338
|
+
execute(node, context) {
|
|
5339
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5340
|
+
const b = Number(context.evaluateInput(node.id, "b", 1));
|
|
5341
|
+
return {
|
|
5342
|
+
outputs: {
|
|
5343
|
+
result: a * b
|
|
5344
|
+
}
|
|
5345
|
+
};
|
|
5346
|
+
}
|
|
5347
|
+
};
|
|
5348
|
+
__name(_MultiplyExecutor, "MultiplyExecutor");
|
|
5349
|
+
var MultiplyExecutor = _MultiplyExecutor;
|
|
5350
|
+
MultiplyExecutor = _ts_decorate10([
|
|
5351
|
+
RegisterNode(MultiplyTemplate)
|
|
5352
|
+
], MultiplyExecutor);
|
|
5353
|
+
var DivideTemplate = {
|
|
5354
|
+
type: "Divide",
|
|
5355
|
+
title: "Divide",
|
|
5356
|
+
category: "math",
|
|
5357
|
+
color: "#4CAF50",
|
|
5358
|
+
description: "Divides A by B (A \u9664\u4EE5 B)",
|
|
5359
|
+
keywords: [
|
|
5360
|
+
"divide",
|
|
5361
|
+
"/",
|
|
5362
|
+
"math"
|
|
5363
|
+
],
|
|
5364
|
+
isPure: true,
|
|
5365
|
+
inputs: [
|
|
5366
|
+
{
|
|
5367
|
+
name: "a",
|
|
5368
|
+
type: "float",
|
|
5369
|
+
displayName: "A",
|
|
5370
|
+
defaultValue: 0
|
|
5371
|
+
},
|
|
5372
|
+
{
|
|
5373
|
+
name: "b",
|
|
5374
|
+
type: "float",
|
|
5375
|
+
displayName: "B",
|
|
5376
|
+
defaultValue: 1
|
|
5377
|
+
}
|
|
5378
|
+
],
|
|
5379
|
+
outputs: [
|
|
5380
|
+
{
|
|
5381
|
+
name: "result",
|
|
5382
|
+
type: "float",
|
|
5383
|
+
displayName: "Result"
|
|
5384
|
+
}
|
|
5385
|
+
]
|
|
5386
|
+
};
|
|
5387
|
+
var _DivideExecutor = class _DivideExecutor {
|
|
5388
|
+
execute(node, context) {
|
|
5389
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5390
|
+
const b = Number(context.evaluateInput(node.id, "b", 1));
|
|
5391
|
+
if (b === 0) {
|
|
5392
|
+
return {
|
|
5393
|
+
outputs: {
|
|
5394
|
+
result: 0
|
|
5395
|
+
}
|
|
5396
|
+
};
|
|
5397
|
+
}
|
|
5398
|
+
return {
|
|
5399
|
+
outputs: {
|
|
5400
|
+
result: a / b
|
|
5401
|
+
}
|
|
5402
|
+
};
|
|
5403
|
+
}
|
|
5404
|
+
};
|
|
5405
|
+
__name(_DivideExecutor, "DivideExecutor");
|
|
5406
|
+
var DivideExecutor = _DivideExecutor;
|
|
5407
|
+
DivideExecutor = _ts_decorate10([
|
|
5408
|
+
RegisterNode(DivideTemplate)
|
|
5409
|
+
], DivideExecutor);
|
|
5410
|
+
var ModuloTemplate = {
|
|
5411
|
+
type: "Modulo",
|
|
5412
|
+
title: "Modulo",
|
|
5413
|
+
category: "math",
|
|
5414
|
+
color: "#4CAF50",
|
|
5415
|
+
description: "Returns the remainder of A divided by B (\u8FD4\u56DE A \u9664\u4EE5 B \u7684\u4F59\u6570)",
|
|
5416
|
+
keywords: [
|
|
5417
|
+
"modulo",
|
|
5418
|
+
"mod",
|
|
5419
|
+
"remainder",
|
|
5420
|
+
"%",
|
|
5421
|
+
"math"
|
|
5422
|
+
],
|
|
5423
|
+
isPure: true,
|
|
5424
|
+
inputs: [
|
|
5425
|
+
{
|
|
5426
|
+
name: "a",
|
|
5427
|
+
type: "float",
|
|
5428
|
+
displayName: "A",
|
|
5429
|
+
defaultValue: 0
|
|
5430
|
+
},
|
|
5431
|
+
{
|
|
5432
|
+
name: "b",
|
|
5433
|
+
type: "float",
|
|
5434
|
+
displayName: "B",
|
|
5435
|
+
defaultValue: 1
|
|
5436
|
+
}
|
|
5437
|
+
],
|
|
5438
|
+
outputs: [
|
|
5439
|
+
{
|
|
5440
|
+
name: "result",
|
|
5441
|
+
type: "float",
|
|
5442
|
+
displayName: "Result"
|
|
5443
|
+
}
|
|
5444
|
+
]
|
|
5445
|
+
};
|
|
5446
|
+
var _ModuloExecutor = class _ModuloExecutor {
|
|
5447
|
+
execute(node, context) {
|
|
5448
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5449
|
+
const b = Number(context.evaluateInput(node.id, "b", 1));
|
|
5450
|
+
if (b === 0) return {
|
|
5451
|
+
outputs: {
|
|
5452
|
+
result: 0
|
|
5453
|
+
}
|
|
5454
|
+
};
|
|
5455
|
+
return {
|
|
5456
|
+
outputs: {
|
|
5457
|
+
result: a % b
|
|
5458
|
+
}
|
|
5459
|
+
};
|
|
5460
|
+
}
|
|
5461
|
+
};
|
|
5462
|
+
__name(_ModuloExecutor, "ModuloExecutor");
|
|
5463
|
+
var ModuloExecutor = _ModuloExecutor;
|
|
5464
|
+
ModuloExecutor = _ts_decorate10([
|
|
5465
|
+
RegisterNode(ModuloTemplate)
|
|
5466
|
+
], ModuloExecutor);
|
|
5467
|
+
var AbsTemplate = {
|
|
5468
|
+
type: "Abs",
|
|
5469
|
+
title: "Absolute",
|
|
5470
|
+
category: "math",
|
|
5471
|
+
color: "#4CAF50",
|
|
5472
|
+
description: "Returns the absolute value (\u8FD4\u56DE\u7EDD\u5BF9\u503C)",
|
|
5473
|
+
keywords: [
|
|
5474
|
+
"abs",
|
|
5475
|
+
"absolute",
|
|
5476
|
+
"math"
|
|
5477
|
+
],
|
|
5478
|
+
isPure: true,
|
|
5479
|
+
inputs: [
|
|
5480
|
+
{
|
|
5481
|
+
name: "value",
|
|
5482
|
+
type: "float",
|
|
5483
|
+
displayName: "Value",
|
|
5484
|
+
defaultValue: 0
|
|
5485
|
+
}
|
|
5486
|
+
],
|
|
5487
|
+
outputs: [
|
|
5488
|
+
{
|
|
5489
|
+
name: "result",
|
|
5490
|
+
type: "float",
|
|
5491
|
+
displayName: "Result"
|
|
5492
|
+
}
|
|
5493
|
+
]
|
|
5494
|
+
};
|
|
5495
|
+
var _AbsExecutor = class _AbsExecutor {
|
|
5496
|
+
execute(node, context) {
|
|
5497
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
5498
|
+
return {
|
|
5499
|
+
outputs: {
|
|
5500
|
+
result: Math.abs(value)
|
|
5501
|
+
}
|
|
5502
|
+
};
|
|
5503
|
+
}
|
|
5504
|
+
};
|
|
5505
|
+
__name(_AbsExecutor, "AbsExecutor");
|
|
5506
|
+
var AbsExecutor = _AbsExecutor;
|
|
5507
|
+
AbsExecutor = _ts_decorate10([
|
|
5508
|
+
RegisterNode(AbsTemplate)
|
|
5509
|
+
], AbsExecutor);
|
|
5510
|
+
var MinTemplate = {
|
|
5511
|
+
type: "Min",
|
|
5512
|
+
title: "Min",
|
|
5513
|
+
category: "math",
|
|
5514
|
+
color: "#4CAF50",
|
|
5515
|
+
description: "Returns the smaller of two values (\u8FD4\u56DE\u4E24\u4E2A\u503C\u4E2D\u8F83\u5C0F\u7684\u4E00\u4E2A)",
|
|
5516
|
+
keywords: [
|
|
5517
|
+
"min",
|
|
5518
|
+
"minimum",
|
|
5519
|
+
"smaller",
|
|
5520
|
+
"math"
|
|
5521
|
+
],
|
|
5522
|
+
isPure: true,
|
|
5523
|
+
inputs: [
|
|
5524
|
+
{
|
|
5525
|
+
name: "a",
|
|
5526
|
+
type: "float",
|
|
5527
|
+
displayName: "A",
|
|
5528
|
+
defaultValue: 0
|
|
5529
|
+
},
|
|
5530
|
+
{
|
|
5531
|
+
name: "b",
|
|
5532
|
+
type: "float",
|
|
5533
|
+
displayName: "B",
|
|
5534
|
+
defaultValue: 0
|
|
5535
|
+
}
|
|
5536
|
+
],
|
|
5537
|
+
outputs: [
|
|
5538
|
+
{
|
|
5539
|
+
name: "result",
|
|
5540
|
+
type: "float",
|
|
5541
|
+
displayName: "Result"
|
|
5542
|
+
}
|
|
5543
|
+
]
|
|
5544
|
+
};
|
|
5545
|
+
var _MinExecutor = class _MinExecutor {
|
|
5546
|
+
execute(node, context) {
|
|
5547
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5548
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
5549
|
+
return {
|
|
5550
|
+
outputs: {
|
|
5551
|
+
result: Math.min(a, b)
|
|
5552
|
+
}
|
|
5553
|
+
};
|
|
5554
|
+
}
|
|
5555
|
+
};
|
|
5556
|
+
__name(_MinExecutor, "MinExecutor");
|
|
5557
|
+
var MinExecutor = _MinExecutor;
|
|
5558
|
+
MinExecutor = _ts_decorate10([
|
|
5559
|
+
RegisterNode(MinTemplate)
|
|
5560
|
+
], MinExecutor);
|
|
5561
|
+
var MaxTemplate = {
|
|
5562
|
+
type: "Max",
|
|
5563
|
+
title: "Max",
|
|
5564
|
+
category: "math",
|
|
5565
|
+
color: "#4CAF50",
|
|
5566
|
+
description: "Returns the larger of two values (\u8FD4\u56DE\u4E24\u4E2A\u503C\u4E2D\u8F83\u5927\u7684\u4E00\u4E2A)",
|
|
5567
|
+
keywords: [
|
|
5568
|
+
"max",
|
|
5569
|
+
"maximum",
|
|
5570
|
+
"larger",
|
|
5571
|
+
"math"
|
|
5572
|
+
],
|
|
5573
|
+
isPure: true,
|
|
5574
|
+
inputs: [
|
|
5575
|
+
{
|
|
5576
|
+
name: "a",
|
|
5577
|
+
type: "float",
|
|
5578
|
+
displayName: "A",
|
|
5579
|
+
defaultValue: 0
|
|
5580
|
+
},
|
|
5581
|
+
{
|
|
5582
|
+
name: "b",
|
|
5583
|
+
type: "float",
|
|
5584
|
+
displayName: "B",
|
|
5585
|
+
defaultValue: 0
|
|
5586
|
+
}
|
|
5587
|
+
],
|
|
5588
|
+
outputs: [
|
|
5589
|
+
{
|
|
5590
|
+
name: "result",
|
|
5591
|
+
type: "float",
|
|
5592
|
+
displayName: "Result"
|
|
5593
|
+
}
|
|
5594
|
+
]
|
|
5595
|
+
};
|
|
5596
|
+
var _MaxExecutor = class _MaxExecutor {
|
|
5597
|
+
execute(node, context) {
|
|
5598
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5599
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
5600
|
+
return {
|
|
5601
|
+
outputs: {
|
|
5602
|
+
result: Math.max(a, b)
|
|
5603
|
+
}
|
|
5604
|
+
};
|
|
5605
|
+
}
|
|
5606
|
+
};
|
|
5607
|
+
__name(_MaxExecutor, "MaxExecutor");
|
|
5608
|
+
var MaxExecutor = _MaxExecutor;
|
|
5609
|
+
MaxExecutor = _ts_decorate10([
|
|
5610
|
+
RegisterNode(MaxTemplate)
|
|
5611
|
+
], MaxExecutor);
|
|
5612
|
+
var ClampTemplate = {
|
|
5613
|
+
type: "Clamp",
|
|
5614
|
+
title: "Clamp",
|
|
5615
|
+
category: "math",
|
|
5616
|
+
color: "#4CAF50",
|
|
5617
|
+
description: "Clamps a value between min and max (\u5C06\u503C\u9650\u5236\u5728\u6700\u5C0F\u548C\u6700\u5927\u4E4B\u95F4)",
|
|
5618
|
+
keywords: [
|
|
5619
|
+
"clamp",
|
|
5620
|
+
"limit",
|
|
5621
|
+
"range",
|
|
5622
|
+
"bound",
|
|
5623
|
+
"math"
|
|
5624
|
+
],
|
|
5625
|
+
isPure: true,
|
|
5626
|
+
inputs: [
|
|
5627
|
+
{
|
|
5628
|
+
name: "value",
|
|
5629
|
+
type: "float",
|
|
5630
|
+
displayName: "Value",
|
|
5631
|
+
defaultValue: 0
|
|
5632
|
+
},
|
|
5633
|
+
{
|
|
5634
|
+
name: "min",
|
|
5635
|
+
type: "float",
|
|
5636
|
+
displayName: "Min",
|
|
5637
|
+
defaultValue: 0
|
|
5638
|
+
},
|
|
5639
|
+
{
|
|
5640
|
+
name: "max",
|
|
5641
|
+
type: "float",
|
|
5642
|
+
displayName: "Max",
|
|
5643
|
+
defaultValue: 1
|
|
5644
|
+
}
|
|
5645
|
+
],
|
|
5646
|
+
outputs: [
|
|
5647
|
+
{
|
|
5648
|
+
name: "result",
|
|
5649
|
+
type: "float",
|
|
5650
|
+
displayName: "Result"
|
|
5651
|
+
}
|
|
5652
|
+
]
|
|
5653
|
+
};
|
|
5654
|
+
var _ClampExecutor = class _ClampExecutor {
|
|
5655
|
+
execute(node, context) {
|
|
5656
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
5657
|
+
const min = Number(context.evaluateInput(node.id, "min", 0));
|
|
5658
|
+
const max = Number(context.evaluateInput(node.id, "max", 1));
|
|
5659
|
+
return {
|
|
5660
|
+
outputs: {
|
|
5661
|
+
result: Math.max(min, Math.min(max, value))
|
|
5662
|
+
}
|
|
5663
|
+
};
|
|
5664
|
+
}
|
|
5665
|
+
};
|
|
5666
|
+
__name(_ClampExecutor, "ClampExecutor");
|
|
5667
|
+
var ClampExecutor = _ClampExecutor;
|
|
5668
|
+
ClampExecutor = _ts_decorate10([
|
|
5669
|
+
RegisterNode(ClampTemplate)
|
|
5670
|
+
], ClampExecutor);
|
|
5671
|
+
var LerpTemplate = {
|
|
5672
|
+
type: "Lerp",
|
|
5673
|
+
title: "Lerp",
|
|
5674
|
+
category: "math",
|
|
5675
|
+
color: "#4CAF50",
|
|
5676
|
+
description: "Linear interpolation between A and B (A \u548C B \u4E4B\u95F4\u7684\u7EBF\u6027\u63D2\u503C)",
|
|
5677
|
+
keywords: [
|
|
5678
|
+
"lerp",
|
|
5679
|
+
"interpolate",
|
|
5680
|
+
"blend",
|
|
5681
|
+
"mix",
|
|
5682
|
+
"math"
|
|
5683
|
+
],
|
|
5684
|
+
isPure: true,
|
|
5685
|
+
inputs: [
|
|
5686
|
+
{
|
|
5687
|
+
name: "a",
|
|
5688
|
+
type: "float",
|
|
5689
|
+
displayName: "A",
|
|
5690
|
+
defaultValue: 0
|
|
5691
|
+
},
|
|
5692
|
+
{
|
|
5693
|
+
name: "b",
|
|
5694
|
+
type: "float",
|
|
5695
|
+
displayName: "B",
|
|
5696
|
+
defaultValue: 1
|
|
5697
|
+
},
|
|
5698
|
+
{
|
|
5699
|
+
name: "t",
|
|
5700
|
+
type: "float",
|
|
5701
|
+
displayName: "Alpha",
|
|
5702
|
+
defaultValue: 0.5
|
|
5703
|
+
}
|
|
5704
|
+
],
|
|
5705
|
+
outputs: [
|
|
5706
|
+
{
|
|
5707
|
+
name: "result",
|
|
5708
|
+
type: "float",
|
|
5709
|
+
displayName: "Result"
|
|
5710
|
+
}
|
|
5711
|
+
]
|
|
5712
|
+
};
|
|
5713
|
+
var _LerpExecutor = class _LerpExecutor {
|
|
5714
|
+
execute(node, context) {
|
|
5715
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
5716
|
+
const b = Number(context.evaluateInput(node.id, "b", 1));
|
|
5717
|
+
const t = Number(context.evaluateInput(node.id, "t", 0.5));
|
|
5718
|
+
return {
|
|
5719
|
+
outputs: {
|
|
5720
|
+
result: a + (b - a) * t
|
|
5721
|
+
}
|
|
5722
|
+
};
|
|
5723
|
+
}
|
|
5724
|
+
};
|
|
5725
|
+
__name(_LerpExecutor, "LerpExecutor");
|
|
5726
|
+
var LerpExecutor = _LerpExecutor;
|
|
5727
|
+
LerpExecutor = _ts_decorate10([
|
|
5728
|
+
RegisterNode(LerpTemplate)
|
|
5729
|
+
], LerpExecutor);
|
|
5730
|
+
var RandomRangeTemplate = {
|
|
5731
|
+
type: "RandomRange",
|
|
5732
|
+
title: "Random Range",
|
|
5733
|
+
category: "math",
|
|
5734
|
+
color: "#4CAF50",
|
|
5735
|
+
description: "Returns a random number between min and max (\u8FD4\u56DE min \u548C max \u4E4B\u95F4\u7684\u968F\u673A\u6570)",
|
|
5736
|
+
keywords: [
|
|
5737
|
+
"random",
|
|
5738
|
+
"range",
|
|
5739
|
+
"rand",
|
|
5740
|
+
"math"
|
|
5741
|
+
],
|
|
5742
|
+
isPure: true,
|
|
5743
|
+
inputs: [
|
|
5744
|
+
{
|
|
5745
|
+
name: "min",
|
|
5746
|
+
type: "float",
|
|
5747
|
+
displayName: "Min",
|
|
5748
|
+
defaultValue: 0
|
|
5749
|
+
},
|
|
5750
|
+
{
|
|
5751
|
+
name: "max",
|
|
5752
|
+
type: "float",
|
|
5753
|
+
displayName: "Max",
|
|
5754
|
+
defaultValue: 1
|
|
5755
|
+
}
|
|
5756
|
+
],
|
|
5757
|
+
outputs: [
|
|
5758
|
+
{
|
|
5759
|
+
name: "result",
|
|
5760
|
+
type: "float",
|
|
5761
|
+
displayName: "Result"
|
|
5762
|
+
}
|
|
5763
|
+
]
|
|
5764
|
+
};
|
|
5765
|
+
var _RandomRangeExecutor = class _RandomRangeExecutor {
|
|
5766
|
+
execute(node, context) {
|
|
5767
|
+
const min = Number(context.evaluateInput(node.id, "min", 0));
|
|
5768
|
+
const max = Number(context.evaluateInput(node.id, "max", 1));
|
|
5769
|
+
return {
|
|
5770
|
+
outputs: {
|
|
5771
|
+
result: min + Math.random() * (max - min)
|
|
5772
|
+
}
|
|
5773
|
+
};
|
|
5774
|
+
}
|
|
5775
|
+
};
|
|
5776
|
+
__name(_RandomRangeExecutor, "RandomRangeExecutor");
|
|
5777
|
+
var RandomRangeExecutor = _RandomRangeExecutor;
|
|
5778
|
+
RandomRangeExecutor = _ts_decorate10([
|
|
5779
|
+
RegisterNode(RandomRangeTemplate)
|
|
5780
|
+
], RandomRangeExecutor);
|
|
5781
|
+
var RandomIntTemplate = {
|
|
5782
|
+
type: "RandomInt",
|
|
5783
|
+
title: "Random Integer",
|
|
5784
|
+
category: "math",
|
|
5785
|
+
color: "#4CAF50",
|
|
5786
|
+
description: "Returns a random integer between min and max inclusive (\u8FD4\u56DE min \u548C max \u4E4B\u95F4\u7684\u968F\u673A\u6574\u6570\uFF0C\u5305\u542B\u8FB9\u754C)",
|
|
5787
|
+
keywords: [
|
|
5788
|
+
"random",
|
|
5789
|
+
"int",
|
|
5790
|
+
"integer",
|
|
5791
|
+
"rand",
|
|
5792
|
+
"math"
|
|
5793
|
+
],
|
|
5794
|
+
isPure: true,
|
|
5795
|
+
inputs: [
|
|
5796
|
+
{
|
|
5797
|
+
name: "min",
|
|
5798
|
+
type: "int",
|
|
5799
|
+
displayName: "Min",
|
|
5800
|
+
defaultValue: 0
|
|
5801
|
+
},
|
|
5802
|
+
{
|
|
5803
|
+
name: "max",
|
|
5804
|
+
type: "int",
|
|
5805
|
+
displayName: "Max",
|
|
5806
|
+
defaultValue: 10
|
|
5807
|
+
}
|
|
5808
|
+
],
|
|
5809
|
+
outputs: [
|
|
5810
|
+
{
|
|
5811
|
+
name: "result",
|
|
5812
|
+
type: "int",
|
|
5813
|
+
displayName: "Result"
|
|
5814
|
+
}
|
|
5815
|
+
]
|
|
5816
|
+
};
|
|
5817
|
+
var _RandomIntExecutor = class _RandomIntExecutor {
|
|
5818
|
+
execute(node, context) {
|
|
5819
|
+
const min = Math.floor(Number(context.evaluateInput(node.id, "min", 0)));
|
|
5820
|
+
const max = Math.floor(Number(context.evaluateInput(node.id, "max", 10)));
|
|
5821
|
+
return {
|
|
5822
|
+
outputs: {
|
|
5823
|
+
result: Math.floor(min + Math.random() * (max - min + 1))
|
|
5824
|
+
}
|
|
5825
|
+
};
|
|
5826
|
+
}
|
|
5827
|
+
};
|
|
5828
|
+
__name(_RandomIntExecutor, "RandomIntExecutor");
|
|
5829
|
+
var RandomIntExecutor = _RandomIntExecutor;
|
|
5830
|
+
RandomIntExecutor = _ts_decorate10([
|
|
5831
|
+
RegisterNode(RandomIntTemplate)
|
|
5832
|
+
], RandomIntExecutor);
|
|
5833
|
+
var PowerTemplate = {
|
|
5834
|
+
type: "Power",
|
|
5835
|
+
title: "Power",
|
|
5836
|
+
category: "math",
|
|
5837
|
+
color: "#4CAF50",
|
|
5838
|
+
description: "Returns base raised to the power of exponent (\u8FD4\u56DE\u5E95\u6570\u7684\u6307\u6570\u6B21\u5E42)",
|
|
5839
|
+
keywords: [
|
|
5840
|
+
"power",
|
|
5841
|
+
"pow",
|
|
5842
|
+
"exponent",
|
|
5843
|
+
"^",
|
|
5844
|
+
"math"
|
|
5845
|
+
],
|
|
5846
|
+
isPure: true,
|
|
5847
|
+
inputs: [
|
|
5848
|
+
{
|
|
5849
|
+
name: "base",
|
|
5850
|
+
type: "float",
|
|
5851
|
+
displayName: "Base",
|
|
5852
|
+
defaultValue: 2
|
|
5853
|
+
},
|
|
5854
|
+
{
|
|
5855
|
+
name: "exponent",
|
|
5856
|
+
type: "float",
|
|
5857
|
+
displayName: "Exponent",
|
|
5858
|
+
defaultValue: 2
|
|
5859
|
+
}
|
|
5860
|
+
],
|
|
5861
|
+
outputs: [
|
|
5862
|
+
{
|
|
5863
|
+
name: "result",
|
|
5864
|
+
type: "float",
|
|
5865
|
+
displayName: "Result"
|
|
5866
|
+
}
|
|
5867
|
+
]
|
|
5868
|
+
};
|
|
5869
|
+
var _PowerExecutor = class _PowerExecutor {
|
|
5870
|
+
execute(node, context) {
|
|
5871
|
+
const base = Number(context.evaluateInput(node.id, "base", 2));
|
|
5872
|
+
const exponent = Number(context.evaluateInput(node.id, "exponent", 2));
|
|
5873
|
+
return {
|
|
5874
|
+
outputs: {
|
|
5875
|
+
result: Math.pow(base, exponent)
|
|
5876
|
+
}
|
|
5877
|
+
};
|
|
5878
|
+
}
|
|
5879
|
+
};
|
|
5880
|
+
__name(_PowerExecutor, "PowerExecutor");
|
|
5881
|
+
var PowerExecutor = _PowerExecutor;
|
|
5882
|
+
PowerExecutor = _ts_decorate10([
|
|
5883
|
+
RegisterNode(PowerTemplate)
|
|
5884
|
+
], PowerExecutor);
|
|
5885
|
+
var SqrtTemplate = {
|
|
5886
|
+
type: "Sqrt",
|
|
5887
|
+
title: "Square Root",
|
|
5888
|
+
category: "math",
|
|
5889
|
+
color: "#4CAF50",
|
|
5890
|
+
description: "Returns the square root (\u8FD4\u56DE\u5E73\u65B9\u6839)",
|
|
5891
|
+
keywords: [
|
|
5892
|
+
"sqrt",
|
|
5893
|
+
"square",
|
|
5894
|
+
"root",
|
|
5895
|
+
"math"
|
|
5896
|
+
],
|
|
5897
|
+
isPure: true,
|
|
5898
|
+
inputs: [
|
|
5899
|
+
{
|
|
5900
|
+
name: "value",
|
|
5901
|
+
type: "float",
|
|
5902
|
+
displayName: "Value",
|
|
5903
|
+
defaultValue: 4
|
|
5904
|
+
}
|
|
5905
|
+
],
|
|
5906
|
+
outputs: [
|
|
5907
|
+
{
|
|
5908
|
+
name: "result",
|
|
5909
|
+
type: "float",
|
|
5910
|
+
displayName: "Result"
|
|
5911
|
+
}
|
|
5912
|
+
]
|
|
5913
|
+
};
|
|
5914
|
+
var _SqrtExecutor = class _SqrtExecutor {
|
|
5915
|
+
execute(node, context) {
|
|
5916
|
+
const value = Number(context.evaluateInput(node.id, "value", 4));
|
|
5917
|
+
return {
|
|
5918
|
+
outputs: {
|
|
5919
|
+
result: Math.sqrt(Math.abs(value))
|
|
5920
|
+
}
|
|
5921
|
+
};
|
|
5922
|
+
}
|
|
5923
|
+
};
|
|
5924
|
+
__name(_SqrtExecutor, "SqrtExecutor");
|
|
5925
|
+
var SqrtExecutor = _SqrtExecutor;
|
|
5926
|
+
SqrtExecutor = _ts_decorate10([
|
|
5927
|
+
RegisterNode(SqrtTemplate)
|
|
5928
|
+
], SqrtExecutor);
|
|
5929
|
+
var FloorTemplate = {
|
|
5930
|
+
type: "Floor",
|
|
5931
|
+
title: "Floor",
|
|
5932
|
+
category: "math",
|
|
5933
|
+
color: "#4CAF50",
|
|
5934
|
+
description: "Rounds down to the nearest integer (\u5411\u4E0B\u53D6\u6574)",
|
|
5935
|
+
keywords: [
|
|
5936
|
+
"floor",
|
|
5937
|
+
"round",
|
|
5938
|
+
"down",
|
|
5939
|
+
"int",
|
|
5940
|
+
"math"
|
|
5941
|
+
],
|
|
5942
|
+
isPure: true,
|
|
5943
|
+
inputs: [
|
|
5944
|
+
{
|
|
5945
|
+
name: "value",
|
|
5946
|
+
type: "float",
|
|
5947
|
+
displayName: "Value",
|
|
5948
|
+
defaultValue: 0
|
|
5949
|
+
}
|
|
5950
|
+
],
|
|
5951
|
+
outputs: [
|
|
5952
|
+
{
|
|
5953
|
+
name: "result",
|
|
5954
|
+
type: "int",
|
|
5955
|
+
displayName: "Result"
|
|
5956
|
+
}
|
|
5957
|
+
]
|
|
5958
|
+
};
|
|
5959
|
+
var _FloorExecutor = class _FloorExecutor {
|
|
5960
|
+
execute(node, context) {
|
|
5961
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
5962
|
+
return {
|
|
5963
|
+
outputs: {
|
|
5964
|
+
result: Math.floor(value)
|
|
5965
|
+
}
|
|
5966
|
+
};
|
|
5967
|
+
}
|
|
5968
|
+
};
|
|
5969
|
+
__name(_FloorExecutor, "FloorExecutor");
|
|
5970
|
+
var FloorExecutor = _FloorExecutor;
|
|
5971
|
+
FloorExecutor = _ts_decorate10([
|
|
5972
|
+
RegisterNode(FloorTemplate)
|
|
5973
|
+
], FloorExecutor);
|
|
5974
|
+
var CeilTemplate = {
|
|
5975
|
+
type: "Ceil",
|
|
5976
|
+
title: "Ceil",
|
|
5977
|
+
category: "math",
|
|
5978
|
+
color: "#4CAF50",
|
|
5979
|
+
description: "Rounds up to the nearest integer (\u5411\u4E0A\u53D6\u6574)",
|
|
5980
|
+
keywords: [
|
|
5981
|
+
"ceil",
|
|
5982
|
+
"ceiling",
|
|
5983
|
+
"round",
|
|
5984
|
+
"up",
|
|
5985
|
+
"int",
|
|
5986
|
+
"math"
|
|
5987
|
+
],
|
|
5988
|
+
isPure: true,
|
|
5989
|
+
inputs: [
|
|
5990
|
+
{
|
|
5991
|
+
name: "value",
|
|
5992
|
+
type: "float",
|
|
5993
|
+
displayName: "Value",
|
|
5994
|
+
defaultValue: 0
|
|
5995
|
+
}
|
|
5996
|
+
],
|
|
5997
|
+
outputs: [
|
|
5998
|
+
{
|
|
5999
|
+
name: "result",
|
|
6000
|
+
type: "int",
|
|
6001
|
+
displayName: "Result"
|
|
6002
|
+
}
|
|
6003
|
+
]
|
|
6004
|
+
};
|
|
6005
|
+
var _CeilExecutor = class _CeilExecutor {
|
|
6006
|
+
execute(node, context) {
|
|
6007
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
6008
|
+
return {
|
|
6009
|
+
outputs: {
|
|
6010
|
+
result: Math.ceil(value)
|
|
6011
|
+
}
|
|
6012
|
+
};
|
|
6013
|
+
}
|
|
6014
|
+
};
|
|
6015
|
+
__name(_CeilExecutor, "CeilExecutor");
|
|
6016
|
+
var CeilExecutor = _CeilExecutor;
|
|
6017
|
+
CeilExecutor = _ts_decorate10([
|
|
6018
|
+
RegisterNode(CeilTemplate)
|
|
6019
|
+
], CeilExecutor);
|
|
6020
|
+
var RoundTemplate = {
|
|
6021
|
+
type: "Round",
|
|
6022
|
+
title: "Round",
|
|
6023
|
+
category: "math",
|
|
6024
|
+
color: "#4CAF50",
|
|
6025
|
+
description: "Rounds to the nearest integer (\u56DB\u820D\u4E94\u5165\u5230\u6700\u8FD1\u7684\u6574\u6570)",
|
|
6026
|
+
keywords: [
|
|
6027
|
+
"round",
|
|
6028
|
+
"int",
|
|
6029
|
+
"math"
|
|
6030
|
+
],
|
|
6031
|
+
isPure: true,
|
|
6032
|
+
inputs: [
|
|
6033
|
+
{
|
|
6034
|
+
name: "value",
|
|
6035
|
+
type: "float",
|
|
6036
|
+
displayName: "Value",
|
|
6037
|
+
defaultValue: 0
|
|
6038
|
+
}
|
|
6039
|
+
],
|
|
6040
|
+
outputs: [
|
|
6041
|
+
{
|
|
6042
|
+
name: "result",
|
|
6043
|
+
type: "int",
|
|
6044
|
+
displayName: "Result"
|
|
6045
|
+
}
|
|
6046
|
+
]
|
|
6047
|
+
};
|
|
6048
|
+
var _RoundExecutor = class _RoundExecutor {
|
|
6049
|
+
execute(node, context) {
|
|
6050
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
6051
|
+
return {
|
|
6052
|
+
outputs: {
|
|
6053
|
+
result: Math.round(value)
|
|
6054
|
+
}
|
|
6055
|
+
};
|
|
6056
|
+
}
|
|
6057
|
+
};
|
|
6058
|
+
__name(_RoundExecutor, "RoundExecutor");
|
|
6059
|
+
var RoundExecutor = _RoundExecutor;
|
|
6060
|
+
RoundExecutor = _ts_decorate10([
|
|
6061
|
+
RegisterNode(RoundTemplate)
|
|
6062
|
+
], RoundExecutor);
|
|
6063
|
+
var NegateTemplate = {
|
|
6064
|
+
type: "Negate",
|
|
6065
|
+
title: "Negate",
|
|
6066
|
+
category: "math",
|
|
6067
|
+
color: "#4CAF50",
|
|
6068
|
+
description: "Returns the negative of a value (\u8FD4\u56DE\u503C\u7684\u8D1F\u6570)",
|
|
6069
|
+
keywords: [
|
|
6070
|
+
"negate",
|
|
6071
|
+
"negative",
|
|
6072
|
+
"minus",
|
|
6073
|
+
"-",
|
|
6074
|
+
"math"
|
|
6075
|
+
],
|
|
6076
|
+
isPure: true,
|
|
6077
|
+
inputs: [
|
|
6078
|
+
{
|
|
6079
|
+
name: "value",
|
|
6080
|
+
type: "float",
|
|
6081
|
+
displayName: "Value",
|
|
6082
|
+
defaultValue: 0
|
|
6083
|
+
}
|
|
6084
|
+
],
|
|
6085
|
+
outputs: [
|
|
6086
|
+
{
|
|
6087
|
+
name: "result",
|
|
6088
|
+
type: "float",
|
|
6089
|
+
displayName: "Result"
|
|
6090
|
+
}
|
|
6091
|
+
]
|
|
6092
|
+
};
|
|
6093
|
+
var _NegateExecutor = class _NegateExecutor {
|
|
6094
|
+
execute(node, context) {
|
|
6095
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
6096
|
+
return {
|
|
6097
|
+
outputs: {
|
|
6098
|
+
result: -value
|
|
6099
|
+
}
|
|
6100
|
+
};
|
|
6101
|
+
}
|
|
6102
|
+
};
|
|
6103
|
+
__name(_NegateExecutor, "NegateExecutor");
|
|
6104
|
+
var NegateExecutor = _NegateExecutor;
|
|
6105
|
+
NegateExecutor = _ts_decorate10([
|
|
6106
|
+
RegisterNode(NegateTemplate)
|
|
6107
|
+
], NegateExecutor);
|
|
6108
|
+
var SignTemplate = {
|
|
6109
|
+
type: "Sign",
|
|
6110
|
+
title: "Sign",
|
|
6111
|
+
category: "math",
|
|
6112
|
+
color: "#4CAF50",
|
|
6113
|
+
description: "Returns -1, 0, or 1 based on the sign of the value (\u6839\u636E\u503C\u7684\u7B26\u53F7\u8FD4\u56DE -1\u30010 \u6216 1)",
|
|
6114
|
+
keywords: [
|
|
6115
|
+
"sign",
|
|
6116
|
+
"positive",
|
|
6117
|
+
"negative",
|
|
6118
|
+
"math"
|
|
6119
|
+
],
|
|
6120
|
+
isPure: true,
|
|
6121
|
+
inputs: [
|
|
6122
|
+
{
|
|
6123
|
+
name: "value",
|
|
6124
|
+
type: "float",
|
|
6125
|
+
displayName: "Value",
|
|
6126
|
+
defaultValue: 0
|
|
6127
|
+
}
|
|
6128
|
+
],
|
|
6129
|
+
outputs: [
|
|
6130
|
+
{
|
|
6131
|
+
name: "result",
|
|
6132
|
+
type: "int",
|
|
6133
|
+
displayName: "Result"
|
|
6134
|
+
}
|
|
6135
|
+
]
|
|
6136
|
+
};
|
|
6137
|
+
var _SignExecutor = class _SignExecutor {
|
|
6138
|
+
execute(node, context) {
|
|
6139
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
6140
|
+
return {
|
|
6141
|
+
outputs: {
|
|
6142
|
+
result: Math.sign(value)
|
|
6143
|
+
}
|
|
6144
|
+
};
|
|
6145
|
+
}
|
|
6146
|
+
};
|
|
6147
|
+
__name(_SignExecutor, "SignExecutor");
|
|
6148
|
+
var SignExecutor = _SignExecutor;
|
|
6149
|
+
SignExecutor = _ts_decorate10([
|
|
6150
|
+
RegisterNode(SignTemplate)
|
|
6151
|
+
], SignExecutor);
|
|
6152
|
+
|
|
6153
|
+
// src/nodes/logic/ComparisonNodes.ts
|
|
6154
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
6155
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6156
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6157
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6158
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6159
|
+
}
|
|
6160
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
6161
|
+
var EqualTemplate = {
|
|
6162
|
+
type: "Equal",
|
|
6163
|
+
title: "Equal",
|
|
6164
|
+
category: "logic",
|
|
6165
|
+
color: "#9C27B0",
|
|
6166
|
+
description: "Returns true if A equals B (\u5982\u679C A \u7B49\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6167
|
+
keywords: [
|
|
6168
|
+
"equal",
|
|
6169
|
+
"==",
|
|
6170
|
+
"same",
|
|
6171
|
+
"compare",
|
|
6172
|
+
"logic"
|
|
6173
|
+
],
|
|
6174
|
+
isPure: true,
|
|
6175
|
+
inputs: [
|
|
6176
|
+
{
|
|
6177
|
+
name: "a",
|
|
6178
|
+
type: "any",
|
|
6179
|
+
displayName: "A"
|
|
6180
|
+
},
|
|
6181
|
+
{
|
|
6182
|
+
name: "b",
|
|
6183
|
+
type: "any",
|
|
6184
|
+
displayName: "B"
|
|
6185
|
+
}
|
|
6186
|
+
],
|
|
6187
|
+
outputs: [
|
|
6188
|
+
{
|
|
6189
|
+
name: "result",
|
|
6190
|
+
type: "bool",
|
|
6191
|
+
displayName: "Result"
|
|
6192
|
+
}
|
|
6193
|
+
]
|
|
6194
|
+
};
|
|
6195
|
+
var _EqualExecutor = class _EqualExecutor {
|
|
6196
|
+
execute(node, context) {
|
|
6197
|
+
const a = context.evaluateInput(node.id, "a", null);
|
|
6198
|
+
const b = context.evaluateInput(node.id, "b", null);
|
|
6199
|
+
return {
|
|
6200
|
+
outputs: {
|
|
6201
|
+
result: a === b
|
|
6202
|
+
}
|
|
6203
|
+
};
|
|
6204
|
+
}
|
|
6205
|
+
};
|
|
6206
|
+
__name(_EqualExecutor, "EqualExecutor");
|
|
6207
|
+
var EqualExecutor = _EqualExecutor;
|
|
6208
|
+
EqualExecutor = _ts_decorate11([
|
|
6209
|
+
RegisterNode(EqualTemplate)
|
|
6210
|
+
], EqualExecutor);
|
|
6211
|
+
var NotEqualTemplate = {
|
|
6212
|
+
type: "NotEqual",
|
|
6213
|
+
title: "Not Equal",
|
|
6214
|
+
category: "logic",
|
|
6215
|
+
color: "#9C27B0",
|
|
6216
|
+
description: "Returns true if A does not equal B (\u5982\u679C A \u4E0D\u7B49\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6217
|
+
keywords: [
|
|
6218
|
+
"not",
|
|
6219
|
+
"equal",
|
|
6220
|
+
"!=",
|
|
6221
|
+
"different",
|
|
6222
|
+
"compare",
|
|
6223
|
+
"logic"
|
|
6224
|
+
],
|
|
6225
|
+
isPure: true,
|
|
6226
|
+
inputs: [
|
|
6227
|
+
{
|
|
6228
|
+
name: "a",
|
|
6229
|
+
type: "any",
|
|
6230
|
+
displayName: "A"
|
|
6231
|
+
},
|
|
6232
|
+
{
|
|
6233
|
+
name: "b",
|
|
6234
|
+
type: "any",
|
|
6235
|
+
displayName: "B"
|
|
6236
|
+
}
|
|
6237
|
+
],
|
|
6238
|
+
outputs: [
|
|
6239
|
+
{
|
|
6240
|
+
name: "result",
|
|
6241
|
+
type: "bool",
|
|
6242
|
+
displayName: "Result"
|
|
6243
|
+
}
|
|
6244
|
+
]
|
|
6245
|
+
};
|
|
6246
|
+
var _NotEqualExecutor = class _NotEqualExecutor {
|
|
6247
|
+
execute(node, context) {
|
|
6248
|
+
const a = context.evaluateInput(node.id, "a", null);
|
|
6249
|
+
const b = context.evaluateInput(node.id, "b", null);
|
|
6250
|
+
return {
|
|
6251
|
+
outputs: {
|
|
6252
|
+
result: a !== b
|
|
6253
|
+
}
|
|
6254
|
+
};
|
|
6255
|
+
}
|
|
6256
|
+
};
|
|
6257
|
+
__name(_NotEqualExecutor, "NotEqualExecutor");
|
|
6258
|
+
var NotEqualExecutor = _NotEqualExecutor;
|
|
6259
|
+
NotEqualExecutor = _ts_decorate11([
|
|
6260
|
+
RegisterNode(NotEqualTemplate)
|
|
6261
|
+
], NotEqualExecutor);
|
|
6262
|
+
var GreaterThanTemplate = {
|
|
6263
|
+
type: "GreaterThan",
|
|
6264
|
+
title: "Greater Than",
|
|
6265
|
+
category: "logic",
|
|
6266
|
+
color: "#9C27B0",
|
|
6267
|
+
description: "Returns true if A is greater than B (\u5982\u679C A \u5927\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6268
|
+
keywords: [
|
|
6269
|
+
"greater",
|
|
6270
|
+
"than",
|
|
6271
|
+
">",
|
|
6272
|
+
"compare",
|
|
6273
|
+
"logic"
|
|
6274
|
+
],
|
|
6275
|
+
isPure: true,
|
|
6276
|
+
inputs: [
|
|
6277
|
+
{
|
|
6278
|
+
name: "a",
|
|
6279
|
+
type: "float",
|
|
6280
|
+
displayName: "A",
|
|
6281
|
+
defaultValue: 0
|
|
6282
|
+
},
|
|
6283
|
+
{
|
|
6284
|
+
name: "b",
|
|
6285
|
+
type: "float",
|
|
6286
|
+
displayName: "B",
|
|
6287
|
+
defaultValue: 0
|
|
6288
|
+
}
|
|
6289
|
+
],
|
|
6290
|
+
outputs: [
|
|
6291
|
+
{
|
|
6292
|
+
name: "result",
|
|
6293
|
+
type: "bool",
|
|
6294
|
+
displayName: "Result"
|
|
6295
|
+
}
|
|
6296
|
+
]
|
|
6297
|
+
};
|
|
6298
|
+
var _GreaterThanExecutor = class _GreaterThanExecutor {
|
|
6299
|
+
execute(node, context) {
|
|
6300
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
6301
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
6302
|
+
return {
|
|
6303
|
+
outputs: {
|
|
6304
|
+
result: a > b
|
|
6305
|
+
}
|
|
6306
|
+
};
|
|
6307
|
+
}
|
|
6308
|
+
};
|
|
6309
|
+
__name(_GreaterThanExecutor, "GreaterThanExecutor");
|
|
6310
|
+
var GreaterThanExecutor = _GreaterThanExecutor;
|
|
6311
|
+
GreaterThanExecutor = _ts_decorate11([
|
|
6312
|
+
RegisterNode(GreaterThanTemplate)
|
|
6313
|
+
], GreaterThanExecutor);
|
|
6314
|
+
var GreaterThanOrEqualTemplate = {
|
|
6315
|
+
type: "GreaterThanOrEqual",
|
|
6316
|
+
title: "Greater Or Equal",
|
|
6317
|
+
category: "logic",
|
|
6318
|
+
color: "#9C27B0",
|
|
6319
|
+
description: "Returns true if A is greater than or equal to B (\u5982\u679C A \u5927\u4E8E\u7B49\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6320
|
+
keywords: [
|
|
6321
|
+
"greater",
|
|
6322
|
+
"equal",
|
|
6323
|
+
">=",
|
|
6324
|
+
"compare",
|
|
6325
|
+
"logic"
|
|
6326
|
+
],
|
|
6327
|
+
isPure: true,
|
|
6328
|
+
inputs: [
|
|
6329
|
+
{
|
|
6330
|
+
name: "a",
|
|
6331
|
+
type: "float",
|
|
6332
|
+
displayName: "A",
|
|
6333
|
+
defaultValue: 0
|
|
6334
|
+
},
|
|
6335
|
+
{
|
|
6336
|
+
name: "b",
|
|
6337
|
+
type: "float",
|
|
6338
|
+
displayName: "B",
|
|
6339
|
+
defaultValue: 0
|
|
6340
|
+
}
|
|
6341
|
+
],
|
|
6342
|
+
outputs: [
|
|
6343
|
+
{
|
|
6344
|
+
name: "result",
|
|
6345
|
+
type: "bool",
|
|
6346
|
+
displayName: "Result"
|
|
6347
|
+
}
|
|
6348
|
+
]
|
|
6349
|
+
};
|
|
6350
|
+
var _GreaterThanOrEqualExecutor = class _GreaterThanOrEqualExecutor {
|
|
6351
|
+
execute(node, context) {
|
|
6352
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
6353
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
6354
|
+
return {
|
|
6355
|
+
outputs: {
|
|
6356
|
+
result: a >= b
|
|
6357
|
+
}
|
|
6358
|
+
};
|
|
6359
|
+
}
|
|
6360
|
+
};
|
|
6361
|
+
__name(_GreaterThanOrEqualExecutor, "GreaterThanOrEqualExecutor");
|
|
6362
|
+
var GreaterThanOrEqualExecutor = _GreaterThanOrEqualExecutor;
|
|
6363
|
+
GreaterThanOrEqualExecutor = _ts_decorate11([
|
|
6364
|
+
RegisterNode(GreaterThanOrEqualTemplate)
|
|
6365
|
+
], GreaterThanOrEqualExecutor);
|
|
6366
|
+
var LessThanTemplate = {
|
|
6367
|
+
type: "LessThan",
|
|
6368
|
+
title: "Less Than",
|
|
6369
|
+
category: "logic",
|
|
6370
|
+
color: "#9C27B0",
|
|
6371
|
+
description: "Returns true if A is less than B (\u5982\u679C A \u5C0F\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6372
|
+
keywords: [
|
|
6373
|
+
"less",
|
|
6374
|
+
"than",
|
|
6375
|
+
"<",
|
|
6376
|
+
"compare",
|
|
6377
|
+
"logic"
|
|
6378
|
+
],
|
|
6379
|
+
isPure: true,
|
|
6380
|
+
inputs: [
|
|
6381
|
+
{
|
|
6382
|
+
name: "a",
|
|
6383
|
+
type: "float",
|
|
6384
|
+
displayName: "A",
|
|
6385
|
+
defaultValue: 0
|
|
6386
|
+
},
|
|
6387
|
+
{
|
|
6388
|
+
name: "b",
|
|
6389
|
+
type: "float",
|
|
6390
|
+
displayName: "B",
|
|
6391
|
+
defaultValue: 0
|
|
6392
|
+
}
|
|
6393
|
+
],
|
|
6394
|
+
outputs: [
|
|
6395
|
+
{
|
|
6396
|
+
name: "result",
|
|
6397
|
+
type: "bool",
|
|
6398
|
+
displayName: "Result"
|
|
6399
|
+
}
|
|
6400
|
+
]
|
|
6401
|
+
};
|
|
6402
|
+
var _LessThanExecutor = class _LessThanExecutor {
|
|
6403
|
+
execute(node, context) {
|
|
6404
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
6405
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
6406
|
+
return {
|
|
6407
|
+
outputs: {
|
|
6408
|
+
result: a < b
|
|
6409
|
+
}
|
|
6410
|
+
};
|
|
6411
|
+
}
|
|
6412
|
+
};
|
|
6413
|
+
__name(_LessThanExecutor, "LessThanExecutor");
|
|
6414
|
+
var LessThanExecutor = _LessThanExecutor;
|
|
6415
|
+
LessThanExecutor = _ts_decorate11([
|
|
6416
|
+
RegisterNode(LessThanTemplate)
|
|
6417
|
+
], LessThanExecutor);
|
|
6418
|
+
var LessThanOrEqualTemplate = {
|
|
6419
|
+
type: "LessThanOrEqual",
|
|
6420
|
+
title: "Less Or Equal",
|
|
6421
|
+
category: "logic",
|
|
6422
|
+
color: "#9C27B0",
|
|
6423
|
+
description: "Returns true if A is less than or equal to B (\u5982\u679C A \u5C0F\u4E8E\u7B49\u4E8E B \u5219\u8FD4\u56DE true)",
|
|
6424
|
+
keywords: [
|
|
6425
|
+
"less",
|
|
6426
|
+
"equal",
|
|
6427
|
+
"<=",
|
|
6428
|
+
"compare",
|
|
6429
|
+
"logic"
|
|
6430
|
+
],
|
|
6431
|
+
isPure: true,
|
|
6432
|
+
inputs: [
|
|
6433
|
+
{
|
|
6434
|
+
name: "a",
|
|
6435
|
+
type: "float",
|
|
6436
|
+
displayName: "A",
|
|
6437
|
+
defaultValue: 0
|
|
6438
|
+
},
|
|
6439
|
+
{
|
|
6440
|
+
name: "b",
|
|
6441
|
+
type: "float",
|
|
6442
|
+
displayName: "B",
|
|
6443
|
+
defaultValue: 0
|
|
6444
|
+
}
|
|
6445
|
+
],
|
|
6446
|
+
outputs: [
|
|
6447
|
+
{
|
|
6448
|
+
name: "result",
|
|
6449
|
+
type: "bool",
|
|
6450
|
+
displayName: "Result"
|
|
6451
|
+
}
|
|
6452
|
+
]
|
|
6453
|
+
};
|
|
6454
|
+
var _LessThanOrEqualExecutor = class _LessThanOrEqualExecutor {
|
|
6455
|
+
execute(node, context) {
|
|
6456
|
+
const a = Number(context.evaluateInput(node.id, "a", 0));
|
|
6457
|
+
const b = Number(context.evaluateInput(node.id, "b", 0));
|
|
6458
|
+
return {
|
|
6459
|
+
outputs: {
|
|
6460
|
+
result: a <= b
|
|
6461
|
+
}
|
|
6462
|
+
};
|
|
6463
|
+
}
|
|
6464
|
+
};
|
|
6465
|
+
__name(_LessThanOrEqualExecutor, "LessThanOrEqualExecutor");
|
|
6466
|
+
var LessThanOrEqualExecutor = _LessThanOrEqualExecutor;
|
|
6467
|
+
LessThanOrEqualExecutor = _ts_decorate11([
|
|
6468
|
+
RegisterNode(LessThanOrEqualTemplate)
|
|
6469
|
+
], LessThanOrEqualExecutor);
|
|
6470
|
+
var AndTemplate = {
|
|
6471
|
+
type: "And",
|
|
6472
|
+
title: "AND",
|
|
6473
|
+
category: "logic",
|
|
6474
|
+
color: "#9C27B0",
|
|
6475
|
+
description: "Returns true if both A and B are true (\u5982\u679C A \u548C B \u90FD\u4E3A true \u5219\u8FD4\u56DE true)",
|
|
6476
|
+
keywords: [
|
|
6477
|
+
"and",
|
|
6478
|
+
"&&",
|
|
6479
|
+
"both",
|
|
6480
|
+
"logic"
|
|
4875
6481
|
],
|
|
4876
6482
|
isPure: true,
|
|
4877
6483
|
inputs: [
|
|
4878
6484
|
{
|
|
4879
6485
|
name: "a",
|
|
4880
|
-
type: "
|
|
6486
|
+
type: "bool",
|
|
4881
6487
|
displayName: "A",
|
|
4882
|
-
defaultValue:
|
|
6488
|
+
defaultValue: false
|
|
4883
6489
|
},
|
|
4884
6490
|
{
|
|
4885
6491
|
name: "b",
|
|
4886
|
-
type: "
|
|
6492
|
+
type: "bool",
|
|
4887
6493
|
displayName: "B",
|
|
4888
|
-
defaultValue:
|
|
6494
|
+
defaultValue: false
|
|
4889
6495
|
}
|
|
4890
6496
|
],
|
|
4891
6497
|
outputs: [
|
|
4892
6498
|
{
|
|
4893
6499
|
name: "result",
|
|
4894
|
-
type: "
|
|
6500
|
+
type: "bool",
|
|
4895
6501
|
displayName: "Result"
|
|
4896
6502
|
}
|
|
4897
6503
|
]
|
|
4898
6504
|
};
|
|
4899
|
-
var
|
|
6505
|
+
var _AndExecutor = class _AndExecutor {
|
|
4900
6506
|
execute(node, context) {
|
|
4901
|
-
const a =
|
|
4902
|
-
const b =
|
|
6507
|
+
const a = Boolean(context.evaluateInput(node.id, "a", false));
|
|
6508
|
+
const b = Boolean(context.evaluateInput(node.id, "b", false));
|
|
4903
6509
|
return {
|
|
4904
6510
|
outputs: {
|
|
4905
|
-
result: a
|
|
6511
|
+
result: a && b
|
|
4906
6512
|
}
|
|
4907
6513
|
};
|
|
4908
6514
|
}
|
|
4909
6515
|
};
|
|
4910
|
-
__name(
|
|
4911
|
-
var
|
|
4912
|
-
|
|
4913
|
-
RegisterNode(
|
|
4914
|
-
],
|
|
4915
|
-
var
|
|
4916
|
-
type: "
|
|
4917
|
-
title: "
|
|
4918
|
-
category: "
|
|
4919
|
-
color: "#
|
|
4920
|
-
description: "
|
|
6516
|
+
__name(_AndExecutor, "AndExecutor");
|
|
6517
|
+
var AndExecutor = _AndExecutor;
|
|
6518
|
+
AndExecutor = _ts_decorate11([
|
|
6519
|
+
RegisterNode(AndTemplate)
|
|
6520
|
+
], AndExecutor);
|
|
6521
|
+
var OrTemplate = {
|
|
6522
|
+
type: "Or",
|
|
6523
|
+
title: "OR",
|
|
6524
|
+
category: "logic",
|
|
6525
|
+
color: "#9C27B0",
|
|
6526
|
+
description: "Returns true if either A or B is true (\u5982\u679C A \u6216 B \u4E3A true \u5219\u8FD4\u56DE true)",
|
|
4921
6527
|
keywords: [
|
|
4922
|
-
"
|
|
4923
|
-
"
|
|
4924
|
-
"
|
|
4925
|
-
"
|
|
6528
|
+
"or",
|
|
6529
|
+
"||",
|
|
6530
|
+
"either",
|
|
6531
|
+
"logic"
|
|
4926
6532
|
],
|
|
4927
6533
|
isPure: true,
|
|
4928
6534
|
inputs: [
|
|
4929
6535
|
{
|
|
4930
6536
|
name: "a",
|
|
4931
|
-
type: "
|
|
6537
|
+
type: "bool",
|
|
4932
6538
|
displayName: "A",
|
|
4933
|
-
defaultValue:
|
|
6539
|
+
defaultValue: false
|
|
4934
6540
|
},
|
|
4935
6541
|
{
|
|
4936
6542
|
name: "b",
|
|
4937
|
-
type: "
|
|
6543
|
+
type: "bool",
|
|
4938
6544
|
displayName: "B",
|
|
4939
|
-
defaultValue:
|
|
6545
|
+
defaultValue: false
|
|
4940
6546
|
}
|
|
4941
6547
|
],
|
|
4942
6548
|
outputs: [
|
|
4943
6549
|
{
|
|
4944
6550
|
name: "result",
|
|
4945
|
-
type: "
|
|
6551
|
+
type: "bool",
|
|
4946
6552
|
displayName: "Result"
|
|
4947
6553
|
}
|
|
4948
6554
|
]
|
|
4949
6555
|
};
|
|
4950
|
-
var
|
|
6556
|
+
var _OrExecutor = class _OrExecutor {
|
|
4951
6557
|
execute(node, context) {
|
|
4952
|
-
const a =
|
|
4953
|
-
const b =
|
|
6558
|
+
const a = Boolean(context.evaluateInput(node.id, "a", false));
|
|
6559
|
+
const b = Boolean(context.evaluateInput(node.id, "b", false));
|
|
4954
6560
|
return {
|
|
4955
6561
|
outputs: {
|
|
4956
|
-
result: a
|
|
6562
|
+
result: a || b
|
|
4957
6563
|
}
|
|
4958
6564
|
};
|
|
4959
6565
|
}
|
|
4960
6566
|
};
|
|
4961
|
-
__name(
|
|
4962
|
-
var
|
|
4963
|
-
|
|
4964
|
-
RegisterNode(
|
|
4965
|
-
],
|
|
4966
|
-
var
|
|
4967
|
-
type: "
|
|
4968
|
-
title: "
|
|
4969
|
-
category: "
|
|
4970
|
-
color: "#
|
|
4971
|
-
description: "
|
|
6567
|
+
__name(_OrExecutor, "OrExecutor");
|
|
6568
|
+
var OrExecutor = _OrExecutor;
|
|
6569
|
+
OrExecutor = _ts_decorate11([
|
|
6570
|
+
RegisterNode(OrTemplate)
|
|
6571
|
+
], OrExecutor);
|
|
6572
|
+
var NotTemplate = {
|
|
6573
|
+
type: "Not",
|
|
6574
|
+
title: "NOT",
|
|
6575
|
+
category: "logic",
|
|
6576
|
+
color: "#9C27B0",
|
|
6577
|
+
description: "Returns the opposite boolean value (\u8FD4\u56DE\u76F8\u53CD\u7684\u5E03\u5C14\u503C)",
|
|
4972
6578
|
keywords: [
|
|
4973
|
-
"
|
|
4974
|
-
"
|
|
4975
|
-
"
|
|
4976
|
-
"
|
|
6579
|
+
"not",
|
|
6580
|
+
"!",
|
|
6581
|
+
"negate",
|
|
6582
|
+
"invert",
|
|
6583
|
+
"logic"
|
|
6584
|
+
],
|
|
6585
|
+
isPure: true,
|
|
6586
|
+
inputs: [
|
|
6587
|
+
{
|
|
6588
|
+
name: "value",
|
|
6589
|
+
type: "bool",
|
|
6590
|
+
displayName: "Value",
|
|
6591
|
+
defaultValue: false
|
|
6592
|
+
}
|
|
6593
|
+
],
|
|
6594
|
+
outputs: [
|
|
6595
|
+
{
|
|
6596
|
+
name: "result",
|
|
6597
|
+
type: "bool",
|
|
6598
|
+
displayName: "Result"
|
|
6599
|
+
}
|
|
6600
|
+
]
|
|
6601
|
+
};
|
|
6602
|
+
var _NotExecutor = class _NotExecutor {
|
|
6603
|
+
execute(node, context) {
|
|
6604
|
+
const value = Boolean(context.evaluateInput(node.id, "value", false));
|
|
6605
|
+
return {
|
|
6606
|
+
outputs: {
|
|
6607
|
+
result: !value
|
|
6608
|
+
}
|
|
6609
|
+
};
|
|
6610
|
+
}
|
|
6611
|
+
};
|
|
6612
|
+
__name(_NotExecutor, "NotExecutor");
|
|
6613
|
+
var NotExecutor = _NotExecutor;
|
|
6614
|
+
NotExecutor = _ts_decorate11([
|
|
6615
|
+
RegisterNode(NotTemplate)
|
|
6616
|
+
], NotExecutor);
|
|
6617
|
+
var XorTemplate = {
|
|
6618
|
+
type: "Xor",
|
|
6619
|
+
title: "XOR",
|
|
6620
|
+
category: "logic",
|
|
6621
|
+
color: "#9C27B0",
|
|
6622
|
+
description: "Returns true if exactly one of A or B is true (\u5982\u679C A \u548C B \u4E2D\u6070\u597D\u6709\u4E00\u4E2A\u4E3A true \u5219\u8FD4\u56DE true)",
|
|
6623
|
+
keywords: [
|
|
6624
|
+
"xor",
|
|
6625
|
+
"exclusive",
|
|
6626
|
+
"or",
|
|
6627
|
+
"logic"
|
|
4977
6628
|
],
|
|
4978
6629
|
isPure: true,
|
|
4979
6630
|
inputs: [
|
|
4980
6631
|
{
|
|
4981
6632
|
name: "a",
|
|
4982
|
-
type: "
|
|
6633
|
+
type: "bool",
|
|
4983
6634
|
displayName: "A",
|
|
4984
|
-
defaultValue:
|
|
6635
|
+
defaultValue: false
|
|
4985
6636
|
},
|
|
4986
6637
|
{
|
|
4987
6638
|
name: "b",
|
|
4988
|
-
type: "
|
|
6639
|
+
type: "bool",
|
|
4989
6640
|
displayName: "B",
|
|
4990
|
-
defaultValue:
|
|
6641
|
+
defaultValue: false
|
|
4991
6642
|
}
|
|
4992
6643
|
],
|
|
4993
6644
|
outputs: [
|
|
4994
6645
|
{
|
|
4995
6646
|
name: "result",
|
|
4996
|
-
type: "
|
|
6647
|
+
type: "bool",
|
|
4997
6648
|
displayName: "Result"
|
|
4998
6649
|
}
|
|
4999
6650
|
]
|
|
5000
6651
|
};
|
|
5001
|
-
var
|
|
6652
|
+
var _XorExecutor = class _XorExecutor {
|
|
5002
6653
|
execute(node, context) {
|
|
5003
|
-
const a =
|
|
5004
|
-
const b =
|
|
6654
|
+
const a = Boolean(context.evaluateInput(node.id, "a", false));
|
|
6655
|
+
const b = Boolean(context.evaluateInput(node.id, "b", false));
|
|
5005
6656
|
return {
|
|
5006
6657
|
outputs: {
|
|
5007
|
-
result: a
|
|
6658
|
+
result: (a || b) && !(a && b)
|
|
5008
6659
|
}
|
|
5009
6660
|
};
|
|
5010
6661
|
}
|
|
5011
6662
|
};
|
|
5012
|
-
__name(
|
|
5013
|
-
var
|
|
5014
|
-
|
|
5015
|
-
RegisterNode(
|
|
5016
|
-
],
|
|
5017
|
-
var
|
|
5018
|
-
type: "
|
|
5019
|
-
title: "
|
|
5020
|
-
category: "
|
|
5021
|
-
color: "#
|
|
5022
|
-
description: "
|
|
6663
|
+
__name(_XorExecutor, "XorExecutor");
|
|
6664
|
+
var XorExecutor = _XorExecutor;
|
|
6665
|
+
XorExecutor = _ts_decorate11([
|
|
6666
|
+
RegisterNode(XorTemplate)
|
|
6667
|
+
], XorExecutor);
|
|
6668
|
+
var NandTemplate = {
|
|
6669
|
+
type: "Nand",
|
|
6670
|
+
title: "NAND",
|
|
6671
|
+
category: "logic",
|
|
6672
|
+
color: "#9C27B0",
|
|
6673
|
+
description: "Returns true if not both A and B are true (\u5982\u679C A \u548C B \u4E0D\u90FD\u4E3A true \u5219\u8FD4\u56DE true)",
|
|
5023
6674
|
keywords: [
|
|
5024
|
-
"
|
|
5025
|
-
"
|
|
5026
|
-
"
|
|
6675
|
+
"nand",
|
|
6676
|
+
"not",
|
|
6677
|
+
"and",
|
|
6678
|
+
"logic"
|
|
5027
6679
|
],
|
|
5028
6680
|
isPure: true,
|
|
5029
6681
|
inputs: [
|
|
5030
6682
|
{
|
|
5031
6683
|
name: "a",
|
|
5032
|
-
type: "
|
|
6684
|
+
type: "bool",
|
|
5033
6685
|
displayName: "A",
|
|
5034
|
-
defaultValue:
|
|
6686
|
+
defaultValue: false
|
|
5035
6687
|
},
|
|
5036
6688
|
{
|
|
5037
6689
|
name: "b",
|
|
5038
|
-
type: "
|
|
6690
|
+
type: "bool",
|
|
5039
6691
|
displayName: "B",
|
|
5040
|
-
defaultValue:
|
|
6692
|
+
defaultValue: false
|
|
5041
6693
|
}
|
|
5042
6694
|
],
|
|
5043
6695
|
outputs: [
|
|
5044
6696
|
{
|
|
5045
6697
|
name: "result",
|
|
6698
|
+
type: "bool",
|
|
6699
|
+
displayName: "Result"
|
|
6700
|
+
}
|
|
6701
|
+
]
|
|
6702
|
+
};
|
|
6703
|
+
var _NandExecutor = class _NandExecutor {
|
|
6704
|
+
execute(node, context) {
|
|
6705
|
+
const a = Boolean(context.evaluateInput(node.id, "a", false));
|
|
6706
|
+
const b = Boolean(context.evaluateInput(node.id, "b", false));
|
|
6707
|
+
return {
|
|
6708
|
+
outputs: {
|
|
6709
|
+
result: !(a && b)
|
|
6710
|
+
}
|
|
6711
|
+
};
|
|
6712
|
+
}
|
|
6713
|
+
};
|
|
6714
|
+
__name(_NandExecutor, "NandExecutor");
|
|
6715
|
+
var NandExecutor = _NandExecutor;
|
|
6716
|
+
NandExecutor = _ts_decorate11([
|
|
6717
|
+
RegisterNode(NandTemplate)
|
|
6718
|
+
], NandExecutor);
|
|
6719
|
+
var InRangeTemplate = {
|
|
6720
|
+
type: "InRange",
|
|
6721
|
+
title: "In Range",
|
|
6722
|
+
category: "logic",
|
|
6723
|
+
color: "#9C27B0",
|
|
6724
|
+
description: "Returns true if value is between min and max (\u5982\u679C\u503C\u5728 min \u548C max \u4E4B\u95F4\u5219\u8FD4\u56DE true)",
|
|
6725
|
+
keywords: [
|
|
6726
|
+
"range",
|
|
6727
|
+
"between",
|
|
6728
|
+
"check",
|
|
6729
|
+
"logic"
|
|
6730
|
+
],
|
|
6731
|
+
isPure: true,
|
|
6732
|
+
inputs: [
|
|
6733
|
+
{
|
|
6734
|
+
name: "value",
|
|
6735
|
+
type: "float",
|
|
6736
|
+
displayName: "Value",
|
|
6737
|
+
defaultValue: 0
|
|
6738
|
+
},
|
|
6739
|
+
{
|
|
6740
|
+
name: "min",
|
|
6741
|
+
type: "float",
|
|
6742
|
+
displayName: "Min",
|
|
6743
|
+
defaultValue: 0
|
|
6744
|
+
},
|
|
6745
|
+
{
|
|
6746
|
+
name: "max",
|
|
5046
6747
|
type: "float",
|
|
6748
|
+
displayName: "Max",
|
|
6749
|
+
defaultValue: 1
|
|
6750
|
+
},
|
|
6751
|
+
{
|
|
6752
|
+
name: "inclusive",
|
|
6753
|
+
type: "bool",
|
|
6754
|
+
displayName: "Inclusive",
|
|
6755
|
+
defaultValue: true
|
|
6756
|
+
}
|
|
6757
|
+
],
|
|
6758
|
+
outputs: [
|
|
6759
|
+
{
|
|
6760
|
+
name: "result",
|
|
6761
|
+
type: "bool",
|
|
5047
6762
|
displayName: "Result"
|
|
5048
6763
|
}
|
|
5049
6764
|
]
|
|
5050
6765
|
};
|
|
5051
|
-
var
|
|
6766
|
+
var _InRangeExecutor = class _InRangeExecutor {
|
|
5052
6767
|
execute(node, context) {
|
|
5053
|
-
const
|
|
5054
|
-
const
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
6768
|
+
const value = Number(context.evaluateInput(node.id, "value", 0));
|
|
6769
|
+
const min = Number(context.evaluateInput(node.id, "min", 0));
|
|
6770
|
+
const max = Number(context.evaluateInput(node.id, "max", 1));
|
|
6771
|
+
const inclusive = Boolean(context.evaluateInput(node.id, "inclusive", true));
|
|
6772
|
+
const result = inclusive ? value >= min && value <= max : value > min && value < max;
|
|
6773
|
+
return {
|
|
6774
|
+
outputs: {
|
|
6775
|
+
result
|
|
6776
|
+
}
|
|
6777
|
+
};
|
|
6778
|
+
}
|
|
6779
|
+
};
|
|
6780
|
+
__name(_InRangeExecutor, "InRangeExecutor");
|
|
6781
|
+
var InRangeExecutor = _InRangeExecutor;
|
|
6782
|
+
InRangeExecutor = _ts_decorate11([
|
|
6783
|
+
RegisterNode(InRangeTemplate)
|
|
6784
|
+
], InRangeExecutor);
|
|
6785
|
+
var IsNullTemplate = {
|
|
6786
|
+
type: "IsNull",
|
|
6787
|
+
title: "Is Null",
|
|
6788
|
+
category: "logic",
|
|
6789
|
+
color: "#9C27B0",
|
|
6790
|
+
description: "Returns true if the value is null or undefined (\u5982\u679C\u503C\u4E3A null \u6216 undefined \u5219\u8FD4\u56DE true)",
|
|
6791
|
+
keywords: [
|
|
6792
|
+
"null",
|
|
6793
|
+
"undefined",
|
|
6794
|
+
"empty",
|
|
6795
|
+
"check",
|
|
6796
|
+
"logic"
|
|
6797
|
+
],
|
|
6798
|
+
isPure: true,
|
|
6799
|
+
inputs: [
|
|
6800
|
+
{
|
|
6801
|
+
name: "value",
|
|
6802
|
+
type: "any",
|
|
6803
|
+
displayName: "Value"
|
|
6804
|
+
}
|
|
6805
|
+
],
|
|
6806
|
+
outputs: [
|
|
6807
|
+
{
|
|
6808
|
+
name: "result",
|
|
6809
|
+
type: "bool",
|
|
6810
|
+
displayName: "Is Null"
|
|
5061
6811
|
}
|
|
6812
|
+
]
|
|
6813
|
+
};
|
|
6814
|
+
var _IsNullExecutor = class _IsNullExecutor {
|
|
6815
|
+
execute(node, context) {
|
|
6816
|
+
const value = context.evaluateInput(node.id, "value", null);
|
|
5062
6817
|
return {
|
|
5063
6818
|
outputs: {
|
|
5064
|
-
result:
|
|
6819
|
+
result: value == null
|
|
5065
6820
|
}
|
|
5066
6821
|
};
|
|
5067
6822
|
}
|
|
5068
6823
|
};
|
|
5069
|
-
__name(
|
|
5070
|
-
var
|
|
5071
|
-
|
|
5072
|
-
RegisterNode(
|
|
5073
|
-
],
|
|
6824
|
+
__name(_IsNullExecutor, "IsNullExecutor");
|
|
6825
|
+
var IsNullExecutor = _IsNullExecutor;
|
|
6826
|
+
IsNullExecutor = _ts_decorate11([
|
|
6827
|
+
RegisterNode(IsNullTemplate)
|
|
6828
|
+
], IsNullExecutor);
|
|
6829
|
+
var SelectTemplate = {
|
|
6830
|
+
type: "Select",
|
|
6831
|
+
title: "Select",
|
|
6832
|
+
category: "logic",
|
|
6833
|
+
color: "#9C27B0",
|
|
6834
|
+
description: "Returns A if condition is true, otherwise returns B (\u5982\u679C\u6761\u4EF6\u4E3A true \u8FD4\u56DE A\uFF0C\u5426\u5219\u8FD4\u56DE B)",
|
|
6835
|
+
keywords: [
|
|
6836
|
+
"select",
|
|
6837
|
+
"choose",
|
|
6838
|
+
"ternary",
|
|
6839
|
+
"?:",
|
|
6840
|
+
"logic"
|
|
6841
|
+
],
|
|
6842
|
+
isPure: true,
|
|
6843
|
+
inputs: [
|
|
6844
|
+
{
|
|
6845
|
+
name: "condition",
|
|
6846
|
+
type: "bool",
|
|
6847
|
+
displayName: "Condition",
|
|
6848
|
+
defaultValue: false
|
|
6849
|
+
},
|
|
6850
|
+
{
|
|
6851
|
+
name: "a",
|
|
6852
|
+
type: "any",
|
|
6853
|
+
displayName: "A (True)"
|
|
6854
|
+
},
|
|
6855
|
+
{
|
|
6856
|
+
name: "b",
|
|
6857
|
+
type: "any",
|
|
6858
|
+
displayName: "B (False)"
|
|
6859
|
+
}
|
|
6860
|
+
],
|
|
6861
|
+
outputs: [
|
|
6862
|
+
{
|
|
6863
|
+
name: "result",
|
|
6864
|
+
type: "any",
|
|
6865
|
+
displayName: "Result"
|
|
6866
|
+
}
|
|
6867
|
+
]
|
|
6868
|
+
};
|
|
6869
|
+
var _SelectExecutor = class _SelectExecutor {
|
|
6870
|
+
execute(node, context) {
|
|
6871
|
+
const condition2 = Boolean(context.evaluateInput(node.id, "condition", false));
|
|
6872
|
+
const a = context.evaluateInput(node.id, "a", null);
|
|
6873
|
+
const b = context.evaluateInput(node.id, "b", null);
|
|
6874
|
+
return {
|
|
6875
|
+
outputs: {
|
|
6876
|
+
result: condition2 ? a : b
|
|
6877
|
+
}
|
|
6878
|
+
};
|
|
6879
|
+
}
|
|
6880
|
+
};
|
|
6881
|
+
__name(_SelectExecutor, "SelectExecutor");
|
|
6882
|
+
var SelectExecutor = _SelectExecutor;
|
|
6883
|
+
SelectExecutor = _ts_decorate11([
|
|
6884
|
+
RegisterNode(SelectTemplate)
|
|
6885
|
+
], SelectExecutor);
|
|
5074
6886
|
|
|
5075
6887
|
// src/nodes/time/GetDeltaTime.ts
|
|
5076
|
-
function
|
|
6888
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
5077
6889
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5078
6890
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5079
6891
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5080
6892
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5081
6893
|
}
|
|
5082
|
-
__name(
|
|
6894
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
5083
6895
|
var GetDeltaTimeTemplate = {
|
|
5084
6896
|
type: "GetDeltaTime",
|
|
5085
6897
|
title: "Get Delta Time",
|
|
@@ -5113,18 +6925,18 @@ var _GetDeltaTimeExecutor = class _GetDeltaTimeExecutor {
|
|
|
5113
6925
|
};
|
|
5114
6926
|
__name(_GetDeltaTimeExecutor, "GetDeltaTimeExecutor");
|
|
5115
6927
|
var GetDeltaTimeExecutor = _GetDeltaTimeExecutor;
|
|
5116
|
-
GetDeltaTimeExecutor =
|
|
6928
|
+
GetDeltaTimeExecutor = _ts_decorate12([
|
|
5117
6929
|
RegisterNode(GetDeltaTimeTemplate)
|
|
5118
6930
|
], GetDeltaTimeExecutor);
|
|
5119
6931
|
|
|
5120
6932
|
// src/nodes/time/GetTime.ts
|
|
5121
|
-
function
|
|
6933
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
5122
6934
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5123
6935
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5124
6936
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5125
6937
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5126
6938
|
}
|
|
5127
|
-
__name(
|
|
6939
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
5128
6940
|
var GetTimeTemplate = {
|
|
5129
6941
|
type: "GetTime",
|
|
5130
6942
|
title: "Get Game Time",
|
|
@@ -5158,18 +6970,18 @@ var _GetTimeExecutor = class _GetTimeExecutor {
|
|
|
5158
6970
|
};
|
|
5159
6971
|
__name(_GetTimeExecutor, "GetTimeExecutor");
|
|
5160
6972
|
var GetTimeExecutor = _GetTimeExecutor;
|
|
5161
|
-
GetTimeExecutor =
|
|
6973
|
+
GetTimeExecutor = _ts_decorate13([
|
|
5162
6974
|
RegisterNode(GetTimeTemplate)
|
|
5163
6975
|
], GetTimeExecutor);
|
|
5164
6976
|
|
|
5165
6977
|
// src/nodes/time/Delay.ts
|
|
5166
|
-
function
|
|
6978
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
5167
6979
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5168
6980
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5169
6981
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5170
6982
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5171
6983
|
}
|
|
5172
|
-
__name(
|
|
6984
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
5173
6985
|
var DelayTemplate = {
|
|
5174
6986
|
type: "Delay",
|
|
5175
6987
|
title: "Delay",
|
|
@@ -5215,18 +7027,18 @@ var _DelayExecutor = class _DelayExecutor {
|
|
|
5215
7027
|
};
|
|
5216
7028
|
__name(_DelayExecutor, "DelayExecutor");
|
|
5217
7029
|
var DelayExecutor = _DelayExecutor;
|
|
5218
|
-
DelayExecutor =
|
|
7030
|
+
DelayExecutor = _ts_decorate14([
|
|
5219
7031
|
RegisterNode(DelayTemplate)
|
|
5220
7032
|
], DelayExecutor);
|
|
5221
7033
|
|
|
5222
7034
|
// src/nodes/debug/Print.ts
|
|
5223
|
-
function
|
|
7035
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
5224
7036
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5225
7037
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5226
7038
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5227
7039
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5228
7040
|
}
|
|
5229
|
-
__name(
|
|
7041
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
5230
7042
|
var PrintTemplate = {
|
|
5231
7043
|
type: "Print",
|
|
5232
7044
|
title: "Print String",
|
|
@@ -5299,7 +7111,7 @@ var _PrintExecutor = class _PrintExecutor {
|
|
|
5299
7111
|
};
|
|
5300
7112
|
__name(_PrintExecutor, "PrintExecutor");
|
|
5301
7113
|
var PrintExecutor = _PrintExecutor;
|
|
5302
|
-
PrintExecutor =
|
|
7114
|
+
PrintExecutor = _ts_decorate15([
|
|
5303
7115
|
RegisterNode(PrintTemplate)
|
|
5304
7116
|
], PrintExecutor);
|
|
5305
7117
|
|