37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import {Cfg} from "../../common/DataParser";
|
|
|
|
export class ItemCardCfg implements Cfg{
|
|
name: "ItemCardCfg";
|
|
|
|
public id: number;
|
|
public parname: number;
|
|
public typeid: number;
|
|
public gradeid: number;
|
|
public weight: number;
|
|
public automatic: number;
|
|
public unlocking: number;
|
|
public unlockingtimes: number;
|
|
public decomposition_to_obtain: number;
|
|
|
|
public decode(data: any) {
|
|
this.id = data.id;
|
|
this.parname = data.parname;
|
|
this.typeid = data.typeid;
|
|
this.gradeid = data.gradeid;
|
|
this.weight = data.weight;
|
|
this.automatic = data.automatic;
|
|
this.unlocking = data.unlocking;
|
|
this.unlockingtimes = data.unlockingtimes;
|
|
this.decomposition_to_obtain = data.decomposition_to_obtain;
|
|
};
|
|
|
|
public isOK (uniqueID: number, param1: any, param2: any): boolean {
|
|
if((param1 == undefined || param1 == null) && (param2 == undefined || param2 == null)){
|
|
return this.id == uniqueID;
|
|
}
|
|
if(param2 == undefined || param2 == null){
|
|
return this.id == uniqueID && this.id == param1;
|
|
}
|
|
return this.id == uniqueID && this.id == param1 && this.id == param2;
|
|
};
|
|
}; |