mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
35 lines
937 B
TypeScript
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;
|
||
|
}
|
||
|
}
|