"use strict";exports.__esModule=!0,exports.createSegmentDefenceWall=void 0;var _tool=require("../../../unity/tool"),_modelApi=require("../../../unity/model-api"),_lodash=require("lodash");const defaultWallSetting={size:.2,wireThickness:.25,intensity:1,height:10,breakpointWidth:.5,breakpointLength:2},createSegmentDefenceWall=async(a,b)=>{let c=(0,_lodash.merge)(defaultWallSetting,a.setting?a.setting:{});if(0===a.walls.length)throw new Error("options.walls \u4E3A\u7A7A");a.walls.forEach(a=>{a.color=(0,_tool.createUnityColor)(a.color||"#66ccff")});const{SegmentWallIDs:d}=await b.unity.invoke(_modelApi.REQUEST_TYPE.CreatSegmentDefenceWallEffect,{SpaceID:a.spaceID,SegmentDefenceWalls:a.walls,GlobleSetting:c});return{ids:d,remove:()=>{b.unity.invoke(_modelApi.REQUEST_TYPE.RemoveSegmentDefeceWallEffect,{Ids:d})},updateColor:a=>{a.forEach(a=>{a.color=(0,_tool.createUnityColor)(a.color||"#66ccff")}),b.unity.invoke(_modelApi.REQUEST_TYPE.UpdateSegmentDefeceWallEffect,{SegemntInfos:a})}}};exports.createSegmentDefenceWall=createSegmentDefenceWall;