JisolGame/JisolGameCocos/assets/resources/config/ts/TableGRoleAttackBullet.ts

35 lines
937 B
TypeScript
Raw Normal View History

2023-10-27 02:38:08 +08:00
import { JsonUtil } from "../../../../extensions/ngame/assets/ngame/util/JsonUtil";
export class TableGRoleAttackBullet {
static TableName: string = "GRoleAttackBullet";
static getAllConfig(): { [id: string]: TableGRoleAttackBullet } {
return JsonUtil.get(TableGRoleAttackBullet.TableName);
}
static getConfig(id: number | string) {
return TableGRoleAttackBullet.getAllConfig()[id] as TableGRoleAttackBullet;
}
private data: any;
init(id: number) {
var table = JsonUtil.get(TableGRoleAttackBullet.TableName);
this.data = table[id];
this._id = id;
}
/** Id */ private _id: number = 0;
/** Id */
get id(): number {
return this.data.id;
}
/** 子弹名称 */
get bulletName(): string {
return this.data.bulletName;
}
/** 子弹地址 */
get bulletSrc(): string {
return this.data.bulletSrc;
}
}