浏览代码

auto config export

Hua 1 年之前
父节点
当前提交
eeca14860d
共有 1 个文件被更改,包括 90 次插入2 次删除
  1. 90 2
      schema/schema.ts

+ 90 - 2
schema/schema.ts

@@ -199,7 +199,7 @@ export class Rectangle extends test.Shape {
199
 
199
 
200
 
200
 
201
 
201
 
202
-export class Item4 {
202
+export class Item {
203
 
203
 
204
     constructor(_buf_: ByteBuf) {
204
     constructor(_buf_: ByteBuf) {
205
         this.id = _buf_.ReadInt()
205
         this.id = _buf_.ReadInt()
@@ -249,7 +249,57 @@ export class Item4 {
249
 
249
 
250
 
250
 
251
 
251
 
252
-export class Item {
252
+export class Item3 {
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
+export class Item4 {
253
 
303
 
254
     constructor(_buf_: ByteBuf) {
304
     constructor(_buf_: ByteBuf) {
255
         this.id = _buf_.ReadInt()
305
         this.id = _buf_.ReadInt()
@@ -333,6 +383,39 @@ export class TbItem {
333
 
383
 
334
 
384
 
335
 
385
 
386
+export class TbItem3 {
387
+    private _dataMap: Map<number, Item3>
388
+    private _dataList: Item3[]
389
+    constructor(_buf_: ByteBuf) {
390
+        this._dataMap = new Map<number, Item3>()
391
+        this._dataList = []
392
+        for(let n = _buf_.ReadInt(); n > 0; n--) {
393
+            let _v: Item3
394
+            _v = new Item3(_buf_)
395
+            this._dataList.push(_v)
396
+            this._dataMap.set(_v.id, _v)
397
+        }
398
+    }
399
+
400
+    getDataMap(): Map<number, Item3> { return this._dataMap; }
401
+    getDataList(): Item3[] { return this._dataList; }
402
+
403
+    get(key: number): Item3 | undefined {
404
+        return this._dataMap.get(key); 
405
+    }
406
+
407
+    resolve(tables:Tables) {
408
+        for(let  data of this._dataList)
409
+        {
410
+            data.resolve(tables)
411
+        }
412
+    }
413
+
414
+}
415
+
416
+
417
+
418
+
336
 export class TbItem4 {
419
 export class TbItem4 {
337
     private _dataMap: Map<number, Item4>
420
     private _dataMap: Map<number, Item4>
338
     private _dataList: Item4[]
421
     private _dataList: Item4[]
@@ -371,21 +454,26 @@ type ByteBufLoader = (file: string) => ByteBuf
371
 export class Tables {
454
 export class Tables {
372
     private _TbItem: TbItem
455
     private _TbItem: TbItem
373
     get TbItem(): TbItem  { return this._TbItem;}
456
     get TbItem(): TbItem  { return this._TbItem;}
457
+    private _TbItem3: TbItem3
458
+    get TbItem3(): TbItem3  { return this._TbItem3;}
374
     private _TbItem4: TbItem4
459
     private _TbItem4: TbItem4
375
     get TbItem4(): TbItem4  { return this._TbItem4;}
460
     get TbItem4(): TbItem4  { return this._TbItem4;}
376
 
461
 
377
     static getTableNames(): string[] {
462
     static getTableNames(): string[] {
378
         let names: string[] = [];
463
         let names: string[] = [];
379
         names.push('tbitem');
464
         names.push('tbitem');
465
+        names.push('tbitem3');
380
         names.push('tbitem4');
466
         names.push('tbitem4');
381
         return names;
467
         return names;
382
     }
468
     }
383
 
469
 
384
     constructor(loader: ByteBufLoader) {
470
     constructor(loader: ByteBufLoader) {
385
         this._TbItem = new TbItem(loader('tbitem'))
471
         this._TbItem = new TbItem(loader('tbitem'))
472
+        this._TbItem3 = new TbItem3(loader('tbitem3'))
386
         this._TbItem4 = new TbItem4(loader('tbitem4'))
473
         this._TbItem4 = new TbItem4(loader('tbitem4'))
387
 
474
 
388
         this._TbItem.resolve(this)
475
         this._TbItem.resolve(this)
476
+        this._TbItem3.resolve(this)
389
         this._TbItem4.resolve(this)
477
         this._TbItem4.resolve(this)
390
     }
478
     }
391
 }
479
 }