123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- //------------------------------------------------------------------------------
- // <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>
- //------------------------------------------------------------------------------
- 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 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 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 TbItem {
- private _dataMap: Map<number, Item>
- private _dataList: Item[]
- constructor(_buf_: ByteBuf) {
- this._dataMap = new Map<number, Item>()
- 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<number, Item> { 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<number, Item4>
- private _dataList: Item4[]
- constructor(_buf_: ByteBuf) {
- this._dataMap = new Map<number, Item4>()
- 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<number, Item4> { 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)
- }
- }
|