This commit is contained in:
PC-20230316NUNE\Administrator
2023-11-27 19:00:51 +08:00
parent 0da4b5e8d8
commit 62959f80e4
19 changed files with 412 additions and 1 deletions

View File

@@ -459,6 +459,72 @@ export class TbSServerInfo {
}
export namespace TB {
export class TbGAttribute {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.name === undefined) { throw new Error() }
this.name = _json_.name
if (_json_.sign === undefined) { throw new Error() }
this.sign = _json_.sign
}
/**
* id
*/
readonly id: number
/**
* 属性名称
*/
readonly name: string
/**
* 属性标识
*/
readonly sign: string
resolve(tables:Tables)
{
}
}
}
export namespace TB {
export class TbGRoleBaseAttribute {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.Attack === undefined) { throw new Error() }
this.Attack = _json_.Attack
if (_json_.Defend === undefined) { throw new Error() }
this.Defend = _json_.Defend
}
/**
* 角色Id (0 则默认)
*/
readonly id: number
/**
* 默认攻击属性
*/
readonly Attack: number
/**
* 默认防御属性
*/
readonly Defend: number
resolve(tables:Tables)
{
}
}
}
export class TbGGlobal{
@@ -813,6 +879,70 @@ export class TbSServerInfo{
export class TbGAttribute{
private _dataMap: Map<number, TB.TbGAttribute>
private _dataList: TB.TbGAttribute[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGAttribute>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGAttribute
_v = new TB.TbGAttribute(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.TbGAttribute> { return this._dataMap; }
getDataList(): TB.TbGAttribute[] { return this._dataList; }
get(key: number): TB.TbGAttribute | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGRoleBaseAttribute{
private _dataMap: Map<number, TB.TbGRoleBaseAttribute>
private _dataList: TB.TbGRoleBaseAttribute[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGRoleBaseAttribute>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGRoleBaseAttribute
_v = new TB.TbGRoleBaseAttribute(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.TbGRoleBaseAttribute> { return this._dataMap; }
getDataList(): TB.TbGRoleBaseAttribute[] { return this._dataList; }
get(key: number): TB.TbGRoleBaseAttribute | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
type JsonLoader = (file: string) => any
export class Tables {
@@ -838,6 +968,10 @@ export class Tables {
get TbGRoleUpStar(): TbGRoleUpStar { return this._TbGRoleUpStar;}
private _TbSServerInfo: TbSServerInfo
get TbSServerInfo(): TbSServerInfo { return this._TbSServerInfo;}
private _TbGAttribute: TbGAttribute
get TbGAttribute(): TbGAttribute { return this._TbGAttribute;}
private _TbGRoleBaseAttribute: TbGRoleBaseAttribute
get TbGRoleBaseAttribute(): TbGRoleBaseAttribute { return this._TbGRoleBaseAttribute;}
constructor(loader: JsonLoader) {
this._TbGGlobal = new TbGGlobal(loader('tbgglobal'))
@@ -851,6 +985,8 @@ export class Tables {
this._TbGRoleUpLevel = new TbGRoleUpLevel(loader('tbgroleuplevel'))
this._TbGRoleUpStar = new TbGRoleUpStar(loader('tbgroleupstar'))
this._TbSServerInfo = new TbSServerInfo(loader('tbsserverinfo'))
this._TbGAttribute = new TbGAttribute(loader('tbgattribute'))
this._TbGRoleBaseAttribute = new TbGRoleBaseAttribute(loader('tbgrolebaseattribute'))
this._TbGGlobal.resolve(this)
this._TbGRole.resolve(this)
@@ -863,5 +999,7 @@ export class Tables {
this._TbGRoleUpLevel.resolve(this)
this._TbGRoleUpStar.resolve(this)
this._TbSServerInfo.resolve(this)
this._TbGAttribute.resolve(this)
this._TbGRoleBaseAttribute.resolve(this)
}
}

View File

@@ -0,0 +1,12 @@
[
{
"id": 110001,
"name": "攻击",
"sign": "Attack"
},
{
"id": 110002,
"name": "防御",
"sign": "Defend"
}
]

View File

@@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "9f49c5b6-38df-450b-8700-3172b090f838",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,7 @@
[
{
"id": 0,
"Attack": 10,
"Defend": 5
}
]

View File

@@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "588bcee5-9782-46ce-9cee-5b9de08327cd",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}