99 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-11-05 04:40:09 +08:00
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
export namespace TB {export namespace Battle {export namespace Role {
export class GRole {
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_.price === undefined) { throw new Error() }
this.price = _json_.price
if(_json_.expire_time != undefined) { this.expireTime = _json_.expire_time } else { this.expireTime = undefined }
}
/**
* id
*/
readonly id: number
/**
*
*/
readonly name: string
/**
*
*/
readonly price: number
/**
*
*/
readonly expireTime: number|undefined
resolve(tables:Tables)
{
}
}
}}}
export class TbGRole{
private _dataMap: Map<number, TB.Battle.Role.GRole>
private _dataList: TB.Battle.Role.GRole[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.Battle.Role.GRole>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.Battle.Role.GRole
_v = new TB.Battle.Role.GRole(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.Battle.Role.GRole> { return this._dataMap; }
getDataList(): TB.Battle.Role.GRole[] { return this._dataList; }
get(key: number): TB.Battle.Role.GRole | 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 {
private _TbGRole: TbGRole
get TbGRole(): TbGRole { return this._TbGRole;}
constructor(loader: JsonLoader) {
this._TbGRole = new TbGRole(loader('tbgrole'))
this._TbGRole.resolve(this)
}
}