import {Cfg} from "../../common/DataParser"; export class SystemCardCfg implements Cfg { public id: number; public typeId: number; public count: number; public point: number; public weight: string; public weightArr: []; public decode(data: any) { this.id = data.id; this.typeId = data.type_id; this.point = data.point; this.weight = data.weight; let arr = this.weight.split('|'); this.weightArr = []; for (let str of arr) { let subArr = str.split(':'); // @ts-ignore this.weightArr.push([parseInt(subArr[0]), parseInt(subArr[1])]); } } }