System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12", "__unresolved_13", "__unresolved_14", "__unresolved_15"], function (_export, _context) { "use strict"; var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, BoxCollider, Component, instantiate, Node, NodePool, Prefab, Quat, RigidBody, tween, Vec3, ch_util, gui, table_level, Hall, UI_Idioms, UI_Main, CreateIdiom, Cube_Infor, Cube_State, GameCtl, ch, table_idiom_order, table_idiom_unorder_1_3, table_idiom_unorder_2_2, table_idiom_unorder_3_1, table_level_2, _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _crd, ccclass, property, Container_Manager; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); } function _reportPossibleCrUseOfch_util(extras) { _reporterNs.report("ch_util", "../../ch/ch_util", _context.meta, extras); } function _reportPossibleCrUseOfgui(extras) { _reporterNs.report("gui", "../../core/ui/ui", _context.meta, extras); } function _reportPossibleCrUseOftable_level(extras) { _reporterNs.report("table_level", "../../module_extra/table_ts/table_level", _context.meta, extras); } function _reportPossibleCrUseOfHall(extras) { _reporterNs.report("Hall", "../hall/Hall", _context.meta, extras); } function _reportPossibleCrUseOfUI_Idioms(extras) { _reporterNs.report("UI_Idioms", "../ui/UI_Idioms/UI_Idioms", _context.meta, extras); } function _reportPossibleCrUseOfUI_Main(extras) { _reporterNs.report("UI_Main", "../ui/UI_Main/UI_Main", _context.meta, extras); } function _reportPossibleCrUseOfCreateIdiom(extras) { _reporterNs.report("CreateIdiom", "./CreateIdiom", _context.meta, extras); } function _reportPossibleCrUseOfCube_Infor(extras) { _reporterNs.report("Cube_Infor", "./Cube_Infor", _context.meta, extras); } function _reportPossibleCrUseOfCube_State(extras) { _reporterNs.report("Cube_State", "./Cube_Infor", _context.meta, extras); } function _reportPossibleCrUseOfGameCtl(extras) { _reporterNs.report("GameCtl", "./GameCtl", _context.meta, extras); } function _reportPossibleCrUseOfch(extras) { _reporterNs.report("ch", "../../ch/ch", _context.meta, extras); } function _reportPossibleCrUseOfLayout_Main(extras) { _reporterNs.report("Layout_Main", "../ui/UI_Main/Layout_Main", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_order(extras) { _reporterNs.report("table_idiom_order", "../../module_extra/table_ts/table_idiom_order", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_1_(extras) { _reporterNs.report("table_idiom_unorder_1_3", "../../module_extra/table_ts/table_idiom_unorder_1_3", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_2_(extras) { _reporterNs.report("table_idiom_unorder_2_2", "../../module_extra/table_ts/table_idiom_unorder_2_2", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_3_(extras) { _reporterNs.report("table_idiom_unorder_3_1", "../../module_extra/table_ts/table_idiom_unorder_3_1", _context.meta, extras); } function _reportPossibleCrUseOftable_level_(extras) { _reporterNs.report("table_level_2", "../../module_extra/table_ts/table_level_2", _context.meta, extras); } return { setters: [function (_unresolved_) { _reporterNs = _unresolved_; }, function (_cc) { _cclegacy = _cc.cclegacy; __checkObsolete__ = _cc.__checkObsolete__; __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__; _decorator = _cc._decorator; BoxCollider = _cc.BoxCollider; Component = _cc.Component; instantiate = _cc.instantiate; Node = _cc.Node; NodePool = _cc.NodePool; Prefab = _cc.Prefab; Quat = _cc.Quat; RigidBody = _cc.RigidBody; tween = _cc.tween; Vec3 = _cc.Vec3; }, function (_unresolved_2) { ch_util = _unresolved_2.default; }, function (_unresolved_3) { gui = _unresolved_3.gui; }, function (_unresolved_4) { table_level = _unresolved_4.table_level; }, function (_unresolved_5) { Hall = _unresolved_5.Hall; }, function (_unresolved_6) { UI_Idioms = _unresolved_6.UI_Idioms; }, function (_unresolved_7) { UI_Main = _unresolved_7.UI_Main; }, function (_unresolved_8) { CreateIdiom = _unresolved_8.CreateIdiom; }, function (_unresolved_9) { Cube_Infor = _unresolved_9.Cube_Infor; Cube_State = _unresolved_9.Cube_State; }, function (_unresolved_10) { GameCtl = _unresolved_10.GameCtl; }, function (_unresolved_11) { ch = _unresolved_11.ch; }, function (_unresolved_12) { table_idiom_order = _unresolved_12.table_idiom_order; }, function (_unresolved_13) { table_idiom_unorder_1_3 = _unresolved_13.table_idiom_unorder_1_3; }, function (_unresolved_14) { table_idiom_unorder_2_2 = _unresolved_14.table_idiom_unorder_2_2; }, function (_unresolved_15) { table_idiom_unorder_3_1 = _unresolved_15.table_idiom_unorder_3_1; }, function (_unresolved_16) { table_level_2 = _unresolved_16.table_level_2; }], execute: function () { _crd = true; _cclegacy._RF.push({}, "e84de8IXbZDjZbYlbQpevuI", "Container_Manager", undefined); __checkObsolete__(['_decorator', 'BoxCollider', 'Component', 'find', 'instantiate', 'Node', 'NodePool', 'Prefab', 'Quat', 'random', 'RigidBody', 'tween', 'Vec3']); ({ ccclass, property } = _decorator); _export("Container_Manager", Container_Manager = (_dec = ccclass('Container_Manager'), _dec2 = property([Node]), _dec3 = property([Prefab]), _dec4 = property(_crd && CreateIdiom === void 0 ? (_reportPossibleCrUseOfCreateIdiom({ error: Error() }), CreateIdiom) : CreateIdiom), _dec5 = property([Node]), _dec(_class = (_class2 = class Container_Manager extends Component { constructor() { super(...arguments); this.canTouch = false; _initializerDefineProperty(this, "Lock_node", _descriptor, this); _initializerDefineProperty(this, "prefabs", _descriptor2, this); this.level_config = null; //关卡配置 this.level2_config = null; //第二关配置 this.config = null; //有规律的成语库 this.config_1_3 = null; //无规律1+3 this.config_2_2 = null; //无规律2+2 this.config_3_1 = null; //无规律3+1 this.idioms = []; //生成的成语 this.index = []; //生成的成语角标,避免生成重复成语 _initializerDefineProperty(this, "create_node", _descriptor3, this); _initializerDefineProperty(this, "nodes", _descriptor4, this); //位置节点 用于成语放入 this.node_isIdiom = new Array(9).fill(false); this.unlock_Num = 7; this.is_Show_UI_Lock = false; this.idiom_combine = new Map(); this.Cube_Pool = new NodePool(); this.nodeReferences = []; // 额外维护的节点引用数组 this.count = 0; } instantiateCube() { for (var i = 0; i < this.idioms.length * 2; i++) { var idiomIndex = Math.floor(i / 2); var isPiece1 = i % 2 === 0; var Text_Length = isPiece1 ? this.idioms[idiomIndex].piece_1_word.length : this.idioms[idiomIndex].piece_2_word.length; var newCube = instantiate(this.prefabs[Text_Length - 1]); newCube.active = true; // 初始时设置为非激活状态 // 按顺序为节点赋值文字内容 newCube.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text = isPiece1 ? this.idioms[idiomIndex].piece_1_word : this.idioms[idiomIndex].piece_2_word; console.log("生成第" + i + "个节点:" + newCube.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text); this.Cube_Pool.put(newCube); } this.shufflePool(); } getCube() { console.log(this.Cube_Pool.size()); var cube = this.Cube_Pool.get(); if (cube) cube.active = true; return cube; } // 将方块回收到对象池 recycleCube(cube) { cube.active = false; // 将方块设置为非激活状态 this.Cube_Pool.put(cube); } //清空对象池 clearCubePool() { this.Cube_Pool.clear(); } //合成规则导入 start() { this.config = (_crd && table_idiom_order === void 0 ? (_reportPossibleCrUseOftable_idiom_order({ error: Error() }), table_idiom_order) : table_idiom_order).getList(); this.config_1_3 = (_crd && table_idiom_unorder_1_3 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_1_({ error: Error() }), table_idiom_unorder_1_3) : table_idiom_unorder_1_3).getList(); this.config_2_2 = (_crd && table_idiom_unorder_2_2 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_2_({ error: Error() }), table_idiom_unorder_2_2) : table_idiom_unorder_2_2).getList(); this.config_3_1 = (_crd && table_idiom_unorder_3_1 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_3_({ error: Error() }), table_idiom_unorder_3_1) : table_idiom_unorder_3_1).getList(); console.log(this.config.length); console.log(this.config_1_3.length); console.log(this.config_2_2.length); console.log(this.config_3_1.length); this.level_config = (_crd && table_level === void 0 ? (_reportPossibleCrUseOftable_level({ error: Error() }), table_level) : table_level).getList(); this.level2_config = (_crd && table_level_2 === void 0 ? (_reportPossibleCrUseOftable_level_({ error: Error() }), table_level_2) : table_level_2).getList(); // if (this.level_config.length === 5) { // console.log("关卡配置导入成功"); // } this.level_idioms(); } update(deltaTime) {} checkIdiom_Combine(matchedcube2, outMatchedCubes) { var _this = this; if (this.idiom_combine.size < 2) { return false; // 至少需要两个方块 } var _loop = function _loop(cube) { // 遍历 idioms 列表,检查是否匹配成语 var matchedIdiom = _this.idioms.find(idiom => idiom.piece_1_word === cube.Text && idiom.piece_2_word === matchedcube2.Text); if (matchedIdiom) { // 匹配成功 outMatchedCubes.push(cube, matchedcube2); _this.nodeReferences = _this.nodeReferences.filter(el => el !== matchedcube2.node && el !== cube.node); console.log("成功拼成成语: " + matchedIdiom.piece_1_word + matchedIdiom.piece_2_word); return { v: true }; } // 再检查逆序组合是否匹配 var reverseMatchedIdiom = _this.idioms.find(idiom => idiom.piece_1_word === matchedcube2.Text && idiom.piece_2_word === cube.Text); if (reverseMatchedIdiom) { // 匹配成功 outMatchedCubes.push(matchedcube2, cube); _this.nodeReferences = _this.nodeReferences.filter(el => el !== matchedcube2.node && el !== cube.node); console.log("成功拼成成语: " + reverseMatchedIdiom.piece_1_word + reverseMatchedIdiom.piece_2_word); return { v: true }; } }, _ret; for (var cube of this.idiom_combine.keys()) { _ret = _loop(cube); if (_ret) return _ret.v; } return false; // 没有匹配到成语 } level_idioms() { var _this2 = this; return _asyncToGenerator(function* () { _this2.Lock_node.forEach(node => { node.active = true; }); _this2.unlock_Num = 7; _this2.is_Show_UI_Lock = false; _this2.canTouch = false; var level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().player.get_max_floor(); for (var i = 0; i < _this2.nodeReferences.length; i++) { if (_this2.nodeReferences[i]) _this2.nodeReferences[i].destroy(); } _this2.clearCubePool(); _this2.idioms = []; _this2.nodeReferences = []; _this2.node_isIdiom = new Array(9).fill(false); _this2.idiom_combine = new Map(); // if (level === 0) { // let str2: string = this.level_config[level].idiom_type_2; // let idiom_type_2 = str2.split("_"); // console.log("idiom_type_2:", idiom_type_2); // let selectedIdioms: Record = {}; // [...idiom_type_2].forEach(rule => { // let filteredIdioms = this.config.filter(item => item.piece_2_word === rule); // if (filteredIdioms.length === 0) { // filteredIdioms = this.config_2_2.filter(item => item.piece_2_word === rule); // } // console.log(`筛选2 ${rule} 后的成语:`, filteredIdioms); // selectedIdioms[rule] = filteredIdioms; // }); // for (let rule in selectedIdioms) { // if (selectedIdioms.hasOwnProperty(rule)) { // this.idioms.push(...selectedIdioms[rule]); // } // } // console.log("最终选中的成语:", this.idioms); // } else if (level === 1) { // for (let i = 0; i < 30; i++) { // let filteredIdiom = this.config.filter(item => item.idiom == this.level2_config[i].idiom); // this.idioms.push(...filteredIdiom); // } // for (let i = 30; i < 40; i++) { // let filteredIdiom = this.config_2_2.filter(item => item.idiom == this.level2_config[i].idiom); // this.idioms.push(...filteredIdiom); // } // } { // 获取当前层级的筛选条件 if (level == 0 || level == 1) { level = 2; } var str1 = _this2.level_config[level].idiom_type_1; var idiom_type_1 = str1.split("_"); // 分割成数组 console.log("idiom_type_1:", idiom_type_1); var str2 = _this2.level_config[level].idiom_type_2; var idiom_type_2 = str2.split("_"); // 分割成数组 console.log("idiom_type_2:", idiom_type_2); var count = _this2.level_config[level].count / (idiom_type_1.length + idiom_type_2.length); // 初始化保存结果的数组 var selectedIdioms = {}; // 遍历 idiom_type_1的每个规律 [...idiom_type_1].forEach(rule => { // 从 config 中筛选符合当前规律的成语 var filteredIdioms = _this2.config.filter(item => item.piece_1_word === rule); console.log("\u7B5B\u9009 " + rule + " \u540E\u7684\u6210\u8BED\uFF1A", filteredIdioms); if (filteredIdioms.length < count) { console.error("\u89C4\u5F8B " + rule + " \u7684\u6210\u8BED\u6570\u91CF\u4E0D\u8DB3\uFF0C\u4EC5\u6709 " + filteredIdioms.length + " \u4E2A"); } else { console.log("\u89C4\u5F8B " + rule + " \u7684\u6210\u8BED\u6570\u91CF\uFF1A" + filteredIdioms.length); var selected = []; // 随机选择不重复的成语 for (var _i = 0; _i < count;) { var rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, filteredIdioms.length - 1); // 确保 rand 在有效范围内 var selectedIdiom = filteredIdioms[rand]; // 从数组中移除已选成语,避免再次选择 filteredIdioms.splice(rand, 1); // 添加到已选数组中 selected.push(selectedIdiom); console.log("\u9009\u4E2D\u7684\u6210\u8BED\uFF1A" + selectedIdiom.idiom); _i++; } selectedIdioms[rule] = selected; } }); // 遍历idiom_type_2 的每个规律 [...idiom_type_2].forEach(rule => { // 从 config 中筛选符合当前规律的成语 var filteredIdioms = _this2.config.filter(item => item.piece_2_word === rule); console.log("\u7B5B\u90092 " + rule + " \u540E\u7684\u6210\u8BED\uFF1A", filteredIdioms); if (filteredIdioms.length < count) { console.error("\u89C4\u5F8B2 " + rule + " \u7684\u6210\u8BED\u6570\u91CF\u4E0D\u8DB3\uFF0C\u4EC5\u6709 " + filteredIdioms.length + " \u4E2A"); } else { console.log("\u89C4\u5F8B2 " + rule + " \u7684\u6210\u8BED\u6570\u91CF\uFF1A" + filteredIdioms.length); var selected = []; // 随机选择不重复的成语 for (var _i2 = 0; _i2 < count;) { var rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, filteredIdioms.length - 1); // 确保 rand 在有效范围内 var selectedIdiom = filteredIdioms[rand]; // 从数组中移除已选成语,避免再次选择 filteredIdioms.splice(rand, 1); // 添加到已选数组中 selected.push(selectedIdiom); console.log("\u9009\u4E2D\u7684\u6210\u8BED\uFF1A" + selectedIdiom.idiom); _i2++; } selectedIdioms[rule] = selected; } }); // 将所有选中的成语合并到 idioms 数组 for (var rule in selectedIdioms) { if (selectedIdioms.hasOwnProperty(rule)) { _this2.idioms.push(...selectedIdioms[rule]); // 使用扩展运算符合并成语 } } // if (_this2.level_config[level].easy_1_3 > 0) { var filteredIdioms = _this2.config_1_3.filter(item => item.difficulty === "easy"); for (var _i3 = 0; _i3 < _this2.level_config[level].easy_1_3; _i3++) { var rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, filteredIdioms.length - 1); var selectedIdiom = filteredIdioms[rand]; filteredIdioms.splice(rand, 1); _this2.idioms.push(selectedIdiom); } } if (_this2.level_config[level].hard_1_3 > 0) { var _filteredIdioms = _this2.config_1_3.filter(item => item.difficulty === "hard"); for (var _i4 = 0; _i4 < _this2.level_config[level].hard_1_3; _i4++) { var _rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, _filteredIdioms.length - 1); var _selectedIdiom = _filteredIdioms[_rand]; _filteredIdioms.splice(_rand, 1); _this2.idioms.push(_selectedIdiom); } } if (_this2.level_config[level].easy_2_2 > 0) { var _filteredIdioms2 = _this2.config_2_2.filter(item => item.difficulty === "easy"); for (var _i5 = 0; _i5 < _this2.level_config[level].easy_2_2; _i5++) { var _rand2 = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, _filteredIdioms2.length - 1); var _selectedIdiom2 = _filteredIdioms2[_rand2]; _filteredIdioms2.splice(_rand2, 1); _this2.idioms.push(_selectedIdiom2); } } if (_this2.level_config[level].hard_2_2 > 0) { var _filteredIdioms3 = _this2.config_2_2.filter(item => item.difficulty === "hard"); for (var _i6 = 0; _i6 < _this2.level_config[level].hard_2_2; _i6++) { var _rand3 = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, _filteredIdioms3.length - 1); var _selectedIdiom3 = _filteredIdioms3[_rand3]; _filteredIdioms3.splice(_rand3, 1); _this2.idioms.push(_selectedIdiom3); } } if (_this2.level_config[level].easy_3_1 > 0) { var _filteredIdioms4 = _this2.config_3_1.filter(item => item.difficulty === "easy"); for (var _i7 = 0; _i7 < _this2.level_config[level].easy_3_1; _i7++) { var _rand4 = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, _filteredIdioms4.length - 1); var _selectedIdiom4 = _filteredIdioms4[_rand4]; _filteredIdioms4.splice(_rand4, 1); _this2.idioms.push(_selectedIdiom4); } } if (_this2.level_config[level].hard_1_3 > 0) { var _filteredIdioms5 = _this2.config_1_3.filter(item => item.difficulty === "hard"); for (var _i8 = 0; _i8 < _this2.level_config[level].hard_1_3; _i8++) { var _rand5 = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, _filteredIdioms5.length - 1); var _selectedIdiom5 = _filteredIdioms5[_rand5]; _filteredIdioms5.splice(_rand5, 1); _this2.idioms.push(_selectedIdiom5); } } console.log("最终选中的成语:", _this2.idioms); // 打印最终的成语数组 } _this2.count = _this2.level_config[level].total; yield _this2.instantiateCube(); yield (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).show(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({ error: Error() }), UI_Idioms) : UI_Idioms); yield _this2.create_node.nodeMoving(); (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).show(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({ error: Error() }), UI_Main) : UI_Main); })(); } //消除一组 eliminate() { var _this3 = this; //先判断槽内是否有方块,如果有,匹配槽内最前面一个与散落方块中的 var cube; for (var [key, value] of this.idiom_combine) { if (value === 0) { cube = key; break; } } //槽中有方块 if (cube) { var originalReferences = [...this.nodeReferences]; var _loop2 = function _loop2(element) { if (_this3.idioms.find(c => c.idiom == element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text + cube.Text) && element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor) !== cube) { console.log(element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text); element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; element.getComponent(BoxCollider).enabled = false; var targetRotation = new Quat(); Quat.fromEuler(targetRotation, -90, 0, 0); element.rotation = targetRotation; // 使用filter过滤掉当前元素 (_crd && GameCtl === void 0 ? (_reportPossibleCrUseOfGameCtl({ error: Error() }), GameCtl) : GameCtl).instance.combine_ani(element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor), cube); _this3.nodeReferences = _this3.nodeReferences.filter(el => el !== element && el !== cube.node); return 0; // break } else if (_this3.idioms.find(c => c.idiom == cube.Text + element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text) && element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor) !== cube) { console.log(element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text); element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; element.getComponent(BoxCollider).enabled = false; var _targetRotation = new Quat(); Quat.fromEuler(_targetRotation, -90, 0, 0); element.rotation = _targetRotation; (_crd && GameCtl === void 0 ? (_reportPossibleCrUseOfGameCtl({ error: Error() }), GameCtl) : GameCtl).instance.combine_ani(cube, element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor)); _this3.nodeReferences = _this3.nodeReferences.filter(el => el !== element && el !== cube.node); return 0; // break } }, _ret2; for (var element of originalReferences) { _ret2 = _loop2(element); if (_ret2 === 0) break; } } //槽中没有方块 else { var flag = false; var originalReferences1 = [...this.nodeReferences]; var originalReferences2 = [...this.nodeReferences]; var _loop3 = function _loop3(element1) { var _loop4 = function _loop4(element2) { if (_this3.idioms.find(c => c.idiom == element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text + element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text)) { element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; var targetRotation = new Quat(); Quat.fromEuler(targetRotation, -90, 0, 0); element1.rotation = targetRotation; element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; element2.getComponent(BoxCollider).enabled = false; element2.rotation = targetRotation; // 使用filter过滤掉当前元素 (_crd && GameCtl === void 0 ? (_reportPossibleCrUseOfGameCtl({ error: Error() }), GameCtl) : GameCtl).instance.combine_ani(element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor), element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor)); _this3.nodeReferences = _this3.nodeReferences.filter(el => el !== element1 && el !== element2); flag = true; return 0; // break } if (_this3.idioms.find(c => c.idiom == element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text + element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text)) { element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; var _targetRotation2 = new Quat(); Quat.fromEuler(_targetRotation2, -90, 0, 0); element1.rotation = _targetRotation2; element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; element2.getComponent(BoxCollider).enabled = false; element2.rotation = _targetRotation2; // 使用filter过滤掉当前元素 (_crd && GameCtl === void 0 ? (_reportPossibleCrUseOfGameCtl({ error: Error() }), GameCtl) : GameCtl).instance.combine_ani(element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor), element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor)); _this3.nodeReferences = _this3.nodeReferences.filter(el => el !== element1 && el !== element2); flag = true; return 0; // break } }, _ret3; for (var element2 of originalReferences2) { _ret3 = _loop4(element2); if (_ret3 === 0) break; } if (flag === true) { return 1; // break } }; for (var element1 of originalReferences1) { if (_loop3(element1)) break; } } } shuffle() { var _this4 = this; return _asyncToGenerator(function* () { // 回收所有非槽内的活跃节点 _this4.nodeReferences.forEach(node => { var cubeInfo = node.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor); if (cubeInfo.state === (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).live) { var targetRotation = new Quat(); Quat.fromEuler(targetRotation, -90, 0, 0); node.rotation = targetRotation; _this4.recycleCube(node); // 回收到池中 } }); _this4.shufflePool(); // 等待节点移动完成后执行后续逻辑 yield _this4.create_node.nodeMoving(); })(); } //清空槽子 Empty() { var _this5 = this; var _loop5 = function _loop5(idiom) { idiom.state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).live; var posX = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({ error: Error() }), ch) : ch).util.getRandom(-3, 3); var posZ = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({ error: Error() }), ch) : ch).util.getRandom(-3, 3); tween(idiom.node).to(0.5, { position: new Vec3(posX, _this5.create_node.node.position.y + 5, posZ) }).call(() => { idiom.rigidbody.type = RigidBody.Type.DYNAMIC; }).start(); //idiom.node.position = ; }; for (var idiom of this.idiom_combine.keys()) { _loop5(idiom); } this.idiom_combine.clear(); this.node_isIdiom.fill(false); (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({ error: Error() }), UI_Idioms) : UI_Idioms).all_light_Hide(); } AddTime() { var layout = (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({ error: Error() }), UI_Main) : UI_Main).getLayout(); layout.time += 120; } shufflePool() { var poolSize = this.Cube_Pool.size(); var tempArray = []; // 从池中取出所有节点到临时数组 for (var i = 0; i < poolSize; i++) { tempArray.push(this.Cube_Pool.get()); } // 只打乱部分节点(以 50% 为例,可调整比例) var shuffleCount = Math.ceil(poolSize * 0.5); // 只打乱前 50% for (var _i9 = 0; _i9 < shuffleCount; _i9++) { var randomIndex = Math.floor(Math.random() * poolSize); [tempArray[_i9], tempArray[randomIndex]] = [tempArray[randomIndex], tempArray[_i9]]; } // 将打乱的节点放回池中 tempArray.forEach(cube => this.Cube_Pool.put(cube)); } }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "Lock_node", [_dec2], { configurable: true, enumerable: true, writable: true, initializer: function initializer() { return []; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "prefabs", [_dec3], { configurable: true, enumerable: true, writable: true, initializer: function initializer() { return []; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "create_node", [_dec4], { configurable: true, enumerable: true, writable: true, initializer: function initializer() { return null; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "nodes", [_dec5], { configurable: true, enumerable: true, writable: true, initializer: function initializer() { return []; } })), _class2)) || _class)); _cclegacy._RF.pop(); _crd = false; } }; }); //# sourceMappingURL=90cb08bdd2589bd4780881bf755dafe0306918a1.js.map