//------------------------------------------------------------------------------ // // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ import ByteBuf from '../bright/serialization/ByteBuf' export namespace test { export enum ETestQuality { /** * 最高品质 */ A = 1, /** * 黑色的 */ B = 2, /** * 蓝色的 */ C = 3, /** * 最差品质 */ D = 4, } } export namespace test { export enum AccessFlag { WRITE = 1, READ = 2, TRUNCATE = 4, NEW = 8, READ_WRITE = WRITE|READ, } } export namespace test { /** * 这是个测试excel结构 */ export class TestExcelBean1 { constructor(_buf_: ByteBuf) { this.x1 = _buf_.ReadInt() this.x2 = _buf_.ReadString() this.x3 = _buf_.ReadInt() this.x4 = _buf_.ReadFloat() } /** * 最高品质 */ readonly x1: number /** * 黑色的 */ readonly x2: string /** * 蓝色的 */ readonly x3: number /** * 最差品质 */ readonly x4: number resolve(tables:Tables) { } } } export namespace test { /** * 这是个测试excel结构 */ export class TestExcelBean2 { constructor(_buf_: ByteBuf) { this.y1 = _buf_.ReadInt() this.y2 = _buf_.ReadString() this.y3 = _buf_.ReadFloat() } /** * 最高品质 */ readonly y1: number /** * 黑色的 */ readonly y2: string /** * 蓝色的 */ readonly y3: number resolve(tables:Tables) { } } } export namespace test { export abstract class Shape { static constructorFrom(_buf_: ByteBuf): Shape{ switch (_buf_.ReadInt()) { case 2131829196: return new test.Circle(_buf_) case 694982337: return new test2.Rectangle(_buf_) default: throw new Error() } } constructor(_buf_: ByteBuf) { } resolve(tables:Tables) { } } } export namespace test { /** * 圆 */ export class Circle extends test.Shape { constructor(_buf_: ByteBuf) { super(_buf_) this.radius = _buf_.ReadFloat() } /** * 半径 */ readonly radius: number resolve(tables:Tables) { super.resolve(tables) } } } export namespace test2 { /** * 矩形 */ export class Rectangle extends test.Shape { constructor(_buf_: ByteBuf) { super(_buf_) this.width = _buf_.ReadFloat() this.height = _buf_.ReadFloat() } /** * 宽度 */ readonly width: number /** * 高度 */ readonly height: number resolve(tables:Tables) { super.resolve(tables) } } } export class Item4 { constructor(_buf_: ByteBuf) { this.id = _buf_.ReadInt() this.name = _buf_.ReadString() this.maxPileNum = _buf_.ReadInt() this.icon = _buf_.ReadString() this.iconBackgroud = _buf_.ReadString() this.desc = _buf_.ReadString() } /** * 道具编号 */ readonly id: number /** * 道具名称 */ readonly name: string /** * 最大叠加数量 */ readonly maxPileNum: number /** * 道具图标 */ readonly icon: string /** * 道具图标底衬 */ readonly iconBackgroud: string /** * 道具说明 */ readonly desc: string resolve(tables:Tables) { } } export class Item { constructor(_buf_: ByteBuf) { this.id = _buf_.ReadInt() this.name = _buf_.ReadString() this.maxPileNum = _buf_.ReadInt() this.icon = _buf_.ReadString() this.iconBackgroud = _buf_.ReadString() this.desc = _buf_.ReadString() } /** * 道具编号 */ readonly id: number /** * 道具名称 */ readonly name: string /** * 最大叠加数量 */ readonly maxPileNum: number /** * 道具图标 */ readonly icon: string /** * 道具图标底衬 */ readonly iconBackgroud: string /** * 道具说明 */ readonly desc: string resolve(tables:Tables) { } } export class TbItem { private _dataMap: Map private _dataList: Item[] constructor(_buf_: ByteBuf) { this._dataMap = new Map() this._dataList = [] for(let n = _buf_.ReadInt(); n > 0; n--) { let _v: Item _v = new Item(_buf_) this._dataList.push(_v) this._dataMap.set(_v.id, _v) } } getDataMap(): Map { return this._dataMap; } getDataList(): Item[] { return this._dataList; } get(key: number): Item | undefined { return this._dataMap.get(key); } resolve(tables:Tables) { for(let data of this._dataList) { data.resolve(tables) } } } export class TbItem4 { private _dataMap: Map private _dataList: Item4[] constructor(_buf_: ByteBuf) { this._dataMap = new Map() this._dataList = [] for(let n = _buf_.ReadInt(); n > 0; n--) { let _v: Item4 _v = new Item4(_buf_) this._dataList.push(_v) this._dataMap.set(_v.id, _v) } } getDataMap(): Map { return this._dataMap; } getDataList(): Item4[] { return this._dataList; } get(key: number): Item4 | undefined { return this._dataMap.get(key); } resolve(tables:Tables) { for(let data of this._dataList) { data.resolve(tables) } } } type ByteBufLoader = (file: string) => ByteBuf export class Tables { private _TbItem: TbItem get TbItem(): TbItem { return this._TbItem;} private _TbItem4: TbItem4 get TbItem4(): TbItem4 { return this._TbItem4;} static getTableNames(): string[] { let names: string[] = []; names.push('tbitem'); names.push('tbitem4'); return names; } constructor(loader: ByteBufLoader) { this._TbItem = new TbItem(loader('tbitem')) this._TbItem4 = new TbItem4(loader('tbitem4')) this._TbItem.resolve(this) this._TbItem4.resolve(this) } }