Hua преди 1 година
ревизия
4739c22073
променени са 1 файла, в които са добавени 392 реда и са изтрити 0 реда
  1. 392 0
      schema/schema.ts

+ 392 - 0
schema/schema.ts

@@ -0,0 +1,392 @@
1
+
2
+//------------------------------------------------------------------------------
3
+// <auto-generated>
4
+//     This code was generated by a tool.
5
+//     Changes to this file may cause incorrect behavior and will be lost if
6
+//     the code is regenerated.
7
+// </auto-generated>
8
+//------------------------------------------------------------------------------
9
+
10
+
11
+import ByteBuf from '../bright/serialization/ByteBuf'
12
+
13
+export namespace test { 
14
+export enum ETestQuality {
15
+    /**
16
+     * 最高品质
17
+     */
18
+    A = 1,
19
+    /**
20
+     * 黑色的
21
+     */
22
+    B = 2,
23
+    /**
24
+     * 蓝色的
25
+     */
26
+    C = 3,
27
+    /**
28
+     * 最差品质
29
+     */
30
+    D = 4,
31
+}
32
+
33
+} 
34
+export namespace test { 
35
+export enum AccessFlag {
36
+    WRITE = 1,
37
+    READ = 2,
38
+    TRUNCATE = 4,
39
+    NEW = 8,
40
+    READ_WRITE = WRITE|READ,
41
+}
42
+
43
+} 
44
+
45
+
46
+
47
+
48
+export namespace test {
49
+/**
50
+ * 这是个测试excel结构
51
+ */
52
+export class TestExcelBean1 {
53
+
54
+    constructor(_buf_: ByteBuf) {
55
+        this.x1 = _buf_.ReadInt()
56
+        this.x2 = _buf_.ReadString()
57
+        this.x3 = _buf_.ReadInt()
58
+        this.x4 = _buf_.ReadFloat()
59
+    }
60
+
61
+    /**
62
+     * 最高品质
63
+     */
64
+    readonly x1: number
65
+    /**
66
+     * 黑色的
67
+     */
68
+    readonly x2: string
69
+    /**
70
+     * 蓝色的
71
+     */
72
+    readonly x3: number
73
+    /**
74
+     * 最差品质
75
+     */
76
+    readonly x4: number
77
+
78
+    resolve(tables:Tables) {
79
+        
80
+        
81
+        
82
+        
83
+    }
84
+}
85
+
86
+}
87
+
88
+
89
+export namespace test {
90
+/**
91
+ * 这是个测试excel结构
92
+ */
93
+export class TestExcelBean2 {
94
+
95
+    constructor(_buf_: ByteBuf) {
96
+        this.y1 = _buf_.ReadInt()
97
+        this.y2 = _buf_.ReadString()
98
+        this.y3 = _buf_.ReadFloat()
99
+    }
100
+
101
+    /**
102
+     * 最高品质
103
+     */
104
+    readonly y1: number
105
+    /**
106
+     * 黑色的
107
+     */
108
+    readonly y2: string
109
+    /**
110
+     * 蓝色的
111
+     */
112
+    readonly y3: number
113
+
114
+    resolve(tables:Tables) {
115
+        
116
+        
117
+        
118
+    }
119
+}
120
+
121
+}
122
+
123
+
124
+export namespace test {
125
+export abstract class Shape {
126
+    static constructorFrom(_buf_: ByteBuf): Shape{
127
+        switch (_buf_.ReadInt()) {
128
+            case 2131829196: return new test.Circle(_buf_)
129
+            case 694982337: return new test2.Rectangle(_buf_)
130
+            default: throw new Error()
131
+        }
132
+    }
133
+
134
+    constructor(_buf_: ByteBuf) {
135
+    }
136
+
137
+
138
+    resolve(tables:Tables) {
139
+    }
140
+}
141
+
142
+}
143
+
144
+
145
+export namespace test {
146
+/**
147
+ * 圆
148
+ */
149
+export class Circle extends test.Shape {
150
+
151
+    constructor(_buf_: ByteBuf) {
152
+        super(_buf_)
153
+        this.radius = _buf_.ReadFloat()
154
+    }
155
+
156
+    /**
157
+     * 半径
158
+     */
159
+    readonly radius: number
160
+
161
+    resolve(tables:Tables) {
162
+        super.resolve(tables)
163
+        
164
+    }
165
+}
166
+
167
+}
168
+
169
+
170
+export namespace test2 {
171
+/**
172
+ * 矩形
173
+ */
174
+export class Rectangle extends test.Shape {
175
+
176
+    constructor(_buf_: ByteBuf) {
177
+        super(_buf_)
178
+        this.width = _buf_.ReadFloat()
179
+        this.height = _buf_.ReadFloat()
180
+    }
181
+
182
+    /**
183
+     * 宽度
184
+     */
185
+    readonly width: number
186
+    /**
187
+     * 高度
188
+     */
189
+    readonly height: number
190
+
191
+    resolve(tables:Tables) {
192
+        super.resolve(tables)
193
+        
194
+        
195
+    }
196
+}
197
+
198
+}
199
+
200
+
201
+
202
+export class Item4 {
203
+
204
+    constructor(_buf_: ByteBuf) {
205
+        this.id = _buf_.ReadInt()
206
+        this.name = _buf_.ReadString()
207
+        this.maxPileNum = _buf_.ReadInt()
208
+        this.icon = _buf_.ReadString()
209
+        this.iconBackgroud = _buf_.ReadString()
210
+        this.desc = _buf_.ReadString()
211
+    }
212
+
213
+    /**
214
+     * 道具编号
215
+     */
216
+    readonly id: number
217
+    /**
218
+     * 道具名称
219
+     */
220
+    readonly name: string
221
+    /**
222
+     * 最大叠加数量
223
+     */
224
+    readonly maxPileNum: number
225
+    /**
226
+     * 道具图标
227
+     */
228
+    readonly icon: string
229
+    /**
230
+     * 道具图标底衬
231
+     */
232
+    readonly iconBackgroud: string
233
+    /**
234
+     * 道具说明
235
+     */
236
+    readonly desc: string
237
+
238
+    resolve(tables:Tables) {
239
+        
240
+        
241
+        
242
+        
243
+        
244
+        
245
+    }
246
+}
247
+
248
+
249
+
250
+
251
+
252
+export class Item {
253
+
254
+    constructor(_buf_: ByteBuf) {
255
+        this.id = _buf_.ReadInt()
256
+        this.name = _buf_.ReadString()
257
+        this.maxPileNum = _buf_.ReadInt()
258
+        this.icon = _buf_.ReadString()
259
+        this.iconBackgroud = _buf_.ReadString()
260
+        this.desc = _buf_.ReadString()
261
+    }
262
+
263
+    /**
264
+     * 道具编号
265
+     */
266
+    readonly id: number
267
+    /**
268
+     * 道具名称
269
+     */
270
+    readonly name: string
271
+    /**
272
+     * 最大叠加数量
273
+     */
274
+    readonly maxPileNum: number
275
+    /**
276
+     * 道具图标
277
+     */
278
+    readonly icon: string
279
+    /**
280
+     * 道具图标底衬
281
+     */
282
+    readonly iconBackgroud: string
283
+    /**
284
+     * 道具说明
285
+     */
286
+    readonly desc: string
287
+
288
+    resolve(tables:Tables) {
289
+        
290
+        
291
+        
292
+        
293
+        
294
+        
295
+    }
296
+}
297
+
298
+
299
+
300
+
301
+
302
+
303
+export class TbItem {
304
+    private _dataMap: Map<number, Item>
305
+    private _dataList: Item[]
306
+    constructor(_buf_: ByteBuf) {
307
+        this._dataMap = new Map<number, Item>()
308
+        this._dataList = []
309
+        for(let n = _buf_.ReadInt(); n > 0; n--) {
310
+            let _v: Item
311
+            _v = new Item(_buf_)
312
+            this._dataList.push(_v)
313
+            this._dataMap.set(_v.id, _v)
314
+        }
315
+    }
316
+
317
+    getDataMap(): Map<number, Item> { return this._dataMap; }
318
+    getDataList(): Item[] { return this._dataList; }
319
+
320
+    get(key: number): Item | undefined {
321
+        return this._dataMap.get(key); 
322
+    }
323
+
324
+    resolve(tables:Tables) {
325
+        for(let  data of this._dataList)
326
+        {
327
+            data.resolve(tables)
328
+        }
329
+    }
330
+
331
+}
332
+
333
+
334
+
335
+
336
+export class TbItem4 {
337
+    private _dataMap: Map<number, Item4>
338
+    private _dataList: Item4[]
339
+    constructor(_buf_: ByteBuf) {
340
+        this._dataMap = new Map<number, Item4>()
341
+        this._dataList = []
342
+        for(let n = _buf_.ReadInt(); n > 0; n--) {
343
+            let _v: Item4
344
+            _v = new Item4(_buf_)
345
+            this._dataList.push(_v)
346
+            this._dataMap.set(_v.id, _v)
347
+        }
348
+    }
349
+
350
+    getDataMap(): Map<number, Item4> { return this._dataMap; }
351
+    getDataList(): Item4[] { return this._dataList; }
352
+
353
+    get(key: number): Item4 | undefined {
354
+        return this._dataMap.get(key); 
355
+    }
356
+
357
+    resolve(tables:Tables) {
358
+        for(let  data of this._dataList)
359
+        {
360
+            data.resolve(tables)
361
+        }
362
+    }
363
+
364
+}
365
+
366
+
367
+
368
+
369
+type ByteBufLoader = (file: string) => ByteBuf
370
+
371
+export class Tables {
372
+    private _TbItem: TbItem
373
+    get TbItem(): TbItem  { return this._TbItem;}
374
+    private _TbItem4: TbItem4
375
+    get TbItem4(): TbItem4  { return this._TbItem4;}
376
+
377
+    static getTableNames(): string[] {
378
+        let names: string[] = [];
379
+        names.push('tbitem');
380
+        names.push('tbitem4');
381
+        return names;
382
+    }
383
+
384
+    constructor(loader: ByteBufLoader) {
385
+        this._TbItem = new TbItem(loader('tbitem'))
386
+        this._TbItem4 = new TbItem4(loader('tbitem4'))
387
+
388
+        this._TbItem.resolve(this)
389
+        this._TbItem4.resolve(this)
390
+    }
391
+}
392
+