fix: 更新提交

This commit is contained in:
han_han9
2025-11-26 22:57:07 +08:00
parent 8a6620cf8f
commit 4c16bec13f
640 changed files with 70914 additions and 13327 deletions

View File

@@ -1,19 +1,5 @@
import { Color } from 'cc';
import { ConfigParseUtils } from './ConfigParseUtils';
import { Color } from "cc";
import { ConfigParseUtils } from "./ConfigParseUtils";
/**
* PetConfig数据结构
@@ -21,133 +7,64 @@ import { ConfigParseUtils } from './ConfigParseUtils';
export class PetConfigData {
private _id: number;
public get id(): number {
return this._id;
}
private _key: string;
public get key(): string {
return this._key;
}
private _bundle: string;
public get bundle(): string {
return this._bundle;
}
private _path: string;
public get path(): string {
return this._path;
}
private _name: string;
public get name(): string {
return this._name;
}
private _color: Color;
public get color(): Color {
return this._color;
}
private _desc: string;
/** id */
public get id(): number {
return this._id;
}
/** key */
public get key(): string {
return this._key;
}
/** bundle */
public get bundle(): string {
return this._bundle;
}
/** 资源路径 */
public get path(): string {
return this._path;
}
/** 宠物名称 */
public get name(): string {
return this._name;
}
/** 颜色 */
public get color(): Color {
return ConfigParseUtils.createReadonlyProxy(ConfigParseUtils.deepFreeze(this._color), '颜色');
}
/** 描述 */
public get desc(): string {
return this._desc;
}
public constructor(
id: number,
key: string,
bundle: string,
path: string,
name: string,
color: Color,
desc: string
) {
this._id = id;
this._key = key;
this._bundle = bundle;
this._path = path;
this._name = name;
this._color = color;
this._desc = desc;
}
}
/**
* 解析配置数据
*/
export function parsePetConfigData(data: any): PetConfigData {
return new PetConfigData(
ConfigParseUtils.parseInt(data.id),
ConfigParseUtils.parseString(data.key),
@@ -161,6 +78,5 @@ export function parsePetConfigData(data: any): PetConfigData {
ConfigParseUtils.parseColor(data.color),
ConfigParseUtils.parseString(data.desc)
);
}
}