import { PropTypeKey , WeaponId } from "../.." ; import { nameToKey , TextMapEN } from "../../TextMapUtil" ; import { dumpFile , layeredAssignment } from "../../Util" ; type EquipAffixExcelConfigData = { "AffixId" : number ; "Id" : WeaponId ; "Level" ? : number ; "NameTextMapHash" : number ; "DescTextMapHash" : number ; "OpenConfig" : string ; "AddProps" : { "PropType" ? : PropTypeKey ; "Value" ? : number ; } [ ] ; "ParamList" : number [ ] ; } ; const equipAffixExcelConfigDataSrc = require ( '../../GenshinData/ExcelBinOutput/EquipAffixExcelConfigData.json' ) as EquipAffixExcelConfigData [ ] ; const equipAffixExcelConfigData = { } as Record < number , EquipAffixExcelConfigData [ ] > ; equipAffixExcelConfigDataSrc . forEach ( data => { const { Id , Level = 0 } = data ; if ( ! equipAffixExcelConfigData [ Id ] ) equipAffixExcelConfigData [ Id ] = [ ] ; layeredAssignment ( equipAffixExcelConfigData , [ Id , Level ] , data ) ; } ) ; dumpFile ( `${ __dirname }/EquipAffixExcelConfigData_idmap_gen.json` , Object . fromEntries ( equipAffixExcelConfigDataSrc . map ( data => [ data . Id , nameToKey ( TextMapEN [ data . NameTextMapHash ] ) ] ) ) ) ; export default equipAffixExcelConfigData ;