2023-10-27 02:38:08 +08:00

35 lines
937 B
TypeScript

import { JsonUtil } from "../../../../extensions/ngame/assets/ngame/util/JsonUtil";
export class TableGRoleAttack {
static TableName: string = "GRoleAttack";
static getAllConfig(): { [id: string]: TableGRoleAttack } {
return JsonUtil.get(TableGRoleAttack.TableName);
}
static getConfig(id: number | string) {
return TableGRoleAttack.getAllConfig()[id] as TableGRoleAttack;
}
private data: any;
init(roleId: number) {
var table = JsonUtil.get(TableGRoleAttack.TableName);
this.data = table[roleId];
this._roleId = roleId;
}
/** 角色Id */
private _roleId: number = 0;
/** 角色Id */
get roleId(): number {
return this.data.roleId;
}
/** 攻击方式 */
get attackWay(): string {
return this.data.attackWay;
}
/** 攻击参数 */
get attackArgs(): string[] {
return this.data.attackArgs;
}
}