fix: 更新提交
This commit is contained in:
@@ -1,130 +1,71 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import { ConfigParseUtils } from './ConfigParseUtils';
|
||||
|
||||
|
||||
|
||||
import { DressSourceType } from './Enums';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import { ConfigParseUtils } from "./ConfigParseUtils";
|
||||
|
||||
/**
|
||||
* PetPartConfig数据结构
|
||||
*/
|
||||
export class PetPartConfigData {
|
||||
|
||||
private _id: number;
|
||||
public get id(): number {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
private _name: string;
|
||||
|
||||
private _bundle: string;
|
||||
|
||||
private _path: string;
|
||||
|
||||
private _sourceType: DressSourceType;
|
||||
|
||||
|
||||
|
||||
|
||||
/** id */
|
||||
|
||||
public get id(): number {
|
||||
|
||||
return this._id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 装扮名称 */
|
||||
|
||||
public get name(): string {
|
||||
|
||||
return this._name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** bundle */
|
||||
|
||||
public get bundle(): string {
|
||||
|
||||
return this._bundle;
|
||||
|
||||
private _sourceName: string;
|
||||
public get sourceName(): string {
|
||||
return this._sourceName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 资源路径 */
|
||||
|
||||
public get path(): string {
|
||||
|
||||
return this._path;
|
||||
|
||||
private _type: number;
|
||||
public get type(): number {
|
||||
return this._type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 资源类型 */
|
||||
|
||||
public get sourceType(): DressSourceType {
|
||||
|
||||
private _sourceType: number;
|
||||
public get sourceType(): number {
|
||||
return this._sourceType;
|
||||
|
||||
}
|
||||
|
||||
private _quality: number;
|
||||
public get quality(): number {
|
||||
return this._quality;
|
||||
}
|
||||
|
||||
public constructor(
|
||||
|
||||
id: number,
|
||||
|
||||
name: string,
|
||||
|
||||
bundle: string,
|
||||
|
||||
path: string,
|
||||
|
||||
sourceType: DressSourceType
|
||||
|
||||
sourceName: string,
|
||||
type: number,
|
||||
sourceType: number,
|
||||
quality: number,
|
||||
) {
|
||||
|
||||
this._id = id;
|
||||
|
||||
this._name = name;
|
||||
|
||||
this._bundle = bundle;
|
||||
|
||||
this._path = path;
|
||||
|
||||
this._sourceName = sourceName;
|
||||
this._type = type;
|
||||
this._sourceType = sourceType;
|
||||
|
||||
this._quality = quality;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析配置数据
|
||||
*/
|
||||
export function parsePetPartConfigData(data: any): PetPartConfigData {
|
||||
return new PetPartConfigData(
|
||||
|
||||
ConfigParseUtils.parseInt(data.id),
|
||||
|
||||
ConfigParseUtils.parseString(data.name),
|
||||
|
||||
ConfigParseUtils.parseString(data.bundle),
|
||||
ConfigParseUtils.parseString(data.sourceName),
|
||||
|
||||
ConfigParseUtils.parseString(data.path),
|
||||
ConfigParseUtils.parseInt(data.type),
|
||||
|
||||
data.sourceType as DressSourceType
|
||||
ConfigParseUtils.parseInt(data.sourceType),
|
||||
|
||||
ConfigParseUtils.parseInt(data.quality),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user