schema.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Changes to this file may cause incorrect behavior and will be lost if
  5. // the code is regenerated.
  6. // </auto-generated>
  7. //------------------------------------------------------------------------------
  8. import ByteBuf from '../bright/serialization/ByteBuf'
  9. export namespace test {
  10. export enum ETestQuality {
  11. /**
  12. * 最高品质
  13. */
  14. A = 1,
  15. /**
  16. * 黑色的
  17. */
  18. B = 2,
  19. /**
  20. * 蓝色的
  21. */
  22. C = 3,
  23. /**
  24. * 最差品质
  25. */
  26. D = 4,
  27. }
  28. }
  29. export namespace test {
  30. export enum AccessFlag {
  31. WRITE = 1,
  32. READ = 2,
  33. TRUNCATE = 4,
  34. NEW = 8,
  35. READ_WRITE = WRITE|READ,
  36. }
  37. }
  38. export enum Quality {
  39. /**
  40. * 普通
  41. */
  42. Normal = 1,
  43. /**
  44. * 高级
  45. */
  46. Senior = 2,
  47. /**
  48. * 稀有
  49. */
  50. Rare = 3,
  51. /**
  52. * 传说
  53. */
  54. Legend = 4,
  55. /**
  56. * 神话
  57. */
  58. Myth = 5,
  59. }
  60. export enum AttackType {
  61. /**
  62. * 近战
  63. */
  64. CloseCombat = 1,
  65. /**
  66. * 远程
  67. */
  68. Remote = 2,
  69. }
  70. export namespace test {
  71. /**
  72. * 这是个测试excel结构
  73. */
  74. export class TestExcelBean1 {
  75. constructor(_buf_: ByteBuf) {
  76. this.x1 = _buf_.ReadInt()
  77. this.x2 = _buf_.ReadString()
  78. this.x3 = _buf_.ReadInt()
  79. this.x4 = _buf_.ReadFloat()
  80. }
  81. /**
  82. * 最高品质
  83. */
  84. readonly x1: number
  85. /**
  86. * 黑色的
  87. */
  88. readonly x2: string
  89. /**
  90. * 蓝色的
  91. */
  92. readonly x3: number
  93. /**
  94. * 最差品质
  95. */
  96. readonly x4: number
  97. resolve(tables:Tables) {
  98. }
  99. }
  100. }
  101. export namespace test {
  102. /**
  103. * 这是个测试excel结构
  104. */
  105. export class TestExcelBean2 {
  106. constructor(_buf_: ByteBuf) {
  107. this.y1 = _buf_.ReadInt()
  108. this.y2 = _buf_.ReadString()
  109. this.y3 = _buf_.ReadFloat()
  110. }
  111. /**
  112. * 最高品质
  113. */
  114. readonly y1: number
  115. /**
  116. * 黑色的
  117. */
  118. readonly y2: string
  119. /**
  120. * 蓝色的
  121. */
  122. readonly y3: number
  123. resolve(tables:Tables) {
  124. }
  125. }
  126. }
  127. export namespace test {
  128. export abstract class Shape {
  129. static constructorFrom(_buf_: ByteBuf): Shape{
  130. switch (_buf_.ReadInt()) {
  131. case 2131829196: return new test.Circle(_buf_)
  132. case 694982337: return new test2.Rectangle(_buf_)
  133. default: throw new Error()
  134. }
  135. }
  136. constructor(_buf_: ByteBuf) {
  137. }
  138. resolve(tables:Tables) {
  139. }
  140. }
  141. }
  142. export namespace test {
  143. /**
  144. * 圆
  145. */
  146. export class Circle extends test.Shape {
  147. constructor(_buf_: ByteBuf) {
  148. super(_buf_)
  149. this.radius = _buf_.ReadFloat()
  150. }
  151. /**
  152. * 半径
  153. */
  154. readonly radius: number
  155. resolve(tables:Tables) {
  156. super.resolve(tables)
  157. }
  158. }
  159. }
  160. export namespace test2 {
  161. /**
  162. * 矩形
  163. */
  164. export class Rectangle extends test.Shape {
  165. constructor(_buf_: ByteBuf) {
  166. super(_buf_)
  167. this.width = _buf_.ReadFloat()
  168. this.height = _buf_.ReadFloat()
  169. }
  170. /**
  171. * 宽度
  172. */
  173. readonly width: number
  174. /**
  175. * 高度
  176. */
  177. readonly height: number
  178. resolve(tables:Tables) {
  179. super.resolve(tables)
  180. }
  181. }
  182. }
  183. export namespace Common {
  184. export class Reward {
  185. constructor(_buf_: ByteBuf) {
  186. this.itemid = _buf_.ReadInt()
  187. this.num = _buf_.ReadInt()
  188. }
  189. /**
  190. * 道具id
  191. */
  192. readonly itemid: number
  193. /**
  194. * 数量
  195. */
  196. readonly num: number
  197. resolve(tables:Tables) {
  198. }
  199. }
  200. }
  201. export namespace Common {
  202. export class Cost {
  203. constructor(_buf_: ByteBuf) {
  204. this.itemid = _buf_.ReadInt()
  205. this.num = _buf_.ReadInt()
  206. }
  207. /**
  208. * 道具id
  209. */
  210. readonly itemid: number
  211. /**
  212. * 数量
  213. */
  214. readonly num: number
  215. resolve(tables:Tables) {
  216. }
  217. }
  218. }
  219. export class Hero {
  220. constructor(_buf_: ByteBuf) {
  221. this.id = _buf_.ReadInt()
  222. this.quality = _buf_.ReadInt()
  223. this.attacktype = _buf_.ReadInt()
  224. this.name = _buf_.ReadString()
  225. { let n = Math.min(_buf_.ReadSize(), _buf_.Size); this.skills = []; for(let i = 0 ; i < n ; i++) { let _e0; _e0 = _buf_.ReadInt(); this.skills.push(_e0);}}
  226. this.isShow = _buf_.ReadInt()
  227. }
  228. /**
  229. * 英雄ID
  230. */
  231. readonly id: number
  232. /**
  233. * 品质
  234. */
  235. readonly quality: Quality
  236. /**
  237. * 攻击类型
  238. */
  239. readonly attacktype: AttackType
  240. /**
  241. * 名字
  242. */
  243. readonly name: string
  244. /**
  245. * 技能列表
  246. */
  247. readonly skills: number[]
  248. /**
  249. * 是否测试
  250. */
  251. readonly isShow: number
  252. resolve(tables:Tables) {
  253. }
  254. }
  255. export class Item {
  256. constructor(_buf_: ByteBuf) {
  257. this.idx = _buf_.ReadInt()
  258. this.type = _buf_.ReadInt()
  259. this.name = _buf_.ReadString()
  260. }
  261. /**
  262. * 道具ID
  263. */
  264. readonly idx: number
  265. /**
  266. * 类型
  267. */
  268. readonly type: number
  269. /**
  270. * 道具名
  271. */
  272. readonly name: string
  273. resolve(tables:Tables) {
  274. }
  275. }
  276. export class WaveRewards {
  277. constructor(_buf_: ByteBuf) {
  278. this.idx = _buf_.ReadInt()
  279. this.waveMin = _buf_.ReadInt()
  280. this.waveMax = _buf_.ReadInt()
  281. this.level = _buf_.ReadInt()
  282. { let n = Math.min(_buf_.ReadSize(), _buf_.Size); this.rewards = []; for(let i = 0 ; i < n ; i++) { let _e0; _e0 = new Common.Reward(_buf_); this.rewards.push(_e0);}}
  283. }
  284. /**
  285. * idx
  286. */
  287. readonly idx: number
  288. /**
  289. * 波数下限
  290. */
  291. readonly waveMin: number
  292. /**
  293. * 波数上限
  294. */
  295. readonly waveMax: number
  296. /**
  297. * 难度
  298. */
  299. readonly level: number
  300. /**
  301. * 奖励列表
  302. */
  303. readonly rewards: Common.Reward[]
  304. resolve(tables:Tables) {
  305. for (let _e of this.rewards) { _e?.resolve(tables); }
  306. }
  307. }
  308. export class SkillBuff {
  309. constructor(_buf_: ByteBuf) {
  310. this.idx = _buf_.ReadInt()
  311. this.remark = _buf_.ReadString()
  312. this.type = _buf_.ReadInt()
  313. this.parameters = _buf_.ReadString()
  314. this.probability = _buf_.ReadInt()
  315. this.triggerCondition = _buf_.ReadString()
  316. this.effectType = _buf_.ReadInt()
  317. this.duration = _buf_.ReadInt()
  318. this.overlapTimes = _buf_.ReadInt()
  319. this.uniqueGain = _buf_.ReadBool()
  320. this.halo = _buf_.ReadBool()
  321. this.attributes = _buf_.ReadString()
  322. this.mixBufficon = _buf_.ReadInt()
  323. this.skillShowId = _buf_.ReadInt()
  324. this.floatingTextId = _buf_.ReadInt()
  325. }
  326. /**
  327. * buffid
  328. */
  329. readonly idx: number
  330. /**
  331. * 备注
  332. */
  333. readonly remark: string
  334. /**
  335. * buff类型
  336. */
  337. readonly type: number
  338. /**
  339. * buff参数
  340. */
  341. readonly parameters: string
  342. /**
  343. * 触发概率
  344. */
  345. readonly probability: number
  346. /**
  347. * 触发条件
  348. */
  349. readonly triggerCondition: string
  350. /**
  351. * 效果类型
  352. */
  353. readonly effectType: number
  354. /**
  355. * 持续时间
  356. */
  357. readonly duration: number
  358. /**
  359. * 叠加次数
  360. */
  361. readonly overlapTimes: number
  362. /**
  363. * 唯一增益
  364. */
  365. readonly uniqueGain: boolean
  366. /**
  367. * 是否是光环
  368. */
  369. readonly halo: boolean
  370. /**
  371. * buff增加的属性
  372. */
  373. readonly attributes: string
  374. /**
  375. * 是否合并
  376. */
  377. readonly mixBufficon: number
  378. /**
  379. * 效果id
  380. */
  381. readonly skillShowId: number
  382. /**
  383. * 飘字id
  384. */
  385. readonly floatingTextId: number
  386. resolve(tables:Tables) {
  387. }
  388. }
  389. export class System {
  390. constructor(_buf_: ByteBuf) {
  391. this.idx = _buf_.ReadInt()
  392. this.mainKey = _buf_.ReadString()
  393. this.value = _buf_.ReadString()
  394. }
  395. /**
  396. * IDX
  397. */
  398. readonly idx: number
  399. /**
  400. * 常量主键
  401. */
  402. readonly mainKey: string
  403. /**
  404. * 常量值
  405. */
  406. readonly value: string
  407. resolve(tables:Tables) {
  408. }
  409. }
  410. export class Wave {
  411. constructor(_buf_: ByteBuf) {
  412. this.idx = _buf_.ReadInt()
  413. this.waveIndex = _buf_.ReadInt()
  414. this.level = _buf_.ReadInt()
  415. this.model = _buf_.ReadInt()
  416. this.counter = _buf_.ReadInt()
  417. this.hp = _buf_.ReadInt()
  418. this.speed = _buf_.ReadInt()
  419. this.gap = _buf_.ReadInt()
  420. this.isboss = _buf_.ReadInt()
  421. this.perAddCoid = _buf_.ReadInt()
  422. this.perAddGem = _buf_.ReadInt()
  423. }
  424. /**
  425. * 唯一id
  426. */
  427. readonly idx: number
  428. /**
  429. * 波数
  430. */
  431. readonly waveIndex: number
  432. /**
  433. * 难度
  434. */
  435. readonly level: number
  436. /**
  437. * 怪物模型
  438. */
  439. readonly model: number
  440. /**
  441. * 数量
  442. */
  443. readonly counter: number
  444. /**
  445. * 血量
  446. */
  447. readonly hp: number
  448. /**
  449. * 速度
  450. */
  451. readonly speed: number
  452. /**
  453. * 间距
  454. */
  455. readonly gap: number
  456. /**
  457. * 是否是boss
  458. */
  459. readonly isboss: number
  460. /**
  461. * 每只怪增加局内金币
  462. */
  463. readonly perAddCoid: number
  464. /**
  465. * 每只怪增加局内宝石
  466. */
  467. readonly perAddGem: number
  468. resolve(tables:Tables) {
  469. }
  470. }
  471. export class Skill {
  472. constructor(_buf_: ByteBuf) {
  473. this.idx = _buf_.ReadInt()
  474. this.remark = _buf_.ReadString()
  475. this.skillId = _buf_.ReadInt()
  476. this.skillType = _buf_.ReadInt()
  477. this.cd = _buf_.ReadInt()
  478. this.gridRange = _buf_.ReadInt()
  479. this.range = _buf_.ReadInt()
  480. this.triggerCondition = _buf_.ReadString()
  481. this.effects = _buf_.ReadString()
  482. this.buffId = _buf_.ReadString()
  483. this.skillName = _buf_.ReadString()
  484. this.desc = _buf_.ReadString()
  485. this.conflictSkillId = _buf_.ReadInt()
  486. }
  487. /**
  488. * 主键id
  489. */
  490. readonly idx: number
  491. /**
  492. * 备注
  493. */
  494. readonly remark: string
  495. /**
  496. * 技能ID
  497. */
  498. readonly skillId: number
  499. /**
  500. * 类型
  501. */
  502. readonly skillType: number
  503. /**
  504. * 冷却时间
  505. */
  506. readonly cd: number
  507. /**
  508. * 格子范围
  509. */
  510. readonly gridRange: number
  511. /**
  512. * 攻击距离
  513. */
  514. readonly range: number
  515. /**
  516. * 技能触发条件
  517. */
  518. readonly triggerCondition: string
  519. /**
  520. * 效果列表
  521. */
  522. readonly effects: string
  523. /**
  524. * buff
  525. */
  526. readonly buffId: string
  527. /**
  528. * 技能名字
  529. */
  530. readonly skillName: string
  531. /**
  532. * 技能描述
  533. */
  534. readonly desc: string
  535. /**
  536. * 冲突的技能id
  537. */
  538. readonly conflictSkillId: number
  539. resolve(tables:Tables) {
  540. }
  541. }
  542. export class HeroLevel {
  543. constructor(_buf_: ByteBuf) {
  544. this.idx = _buf_.ReadInt()
  545. this.id = _buf_.ReadInt()
  546. this.level = _buf_.ReadInt()
  547. { let n = Math.min(_buf_.ReadSize(), _buf_.Size); this.unlockSkill = []; for(let i = 0 ; i < n ; i++) { let _e0; _e0 = _buf_.ReadInt(); this.unlockSkill.push(_e0);}}
  548. this.unlockSkillDesc = _buf_.ReadString()
  549. { let n = Math.min(_buf_.ReadSize(), _buf_.Size); this.upgradeconsume = []; for(let i = 0 ; i < n ; i++) { let _e0; _e0 = new Common.Cost(_buf_); this.upgradeconsume.push(_e0);}}
  550. this.atk = _buf_.ReadInt()
  551. this.atkSpeed = _buf_.ReadInt()
  552. }
  553. /**
  554. * 序號
  555. */
  556. readonly idx: number
  557. /**
  558. * 英雄ID
  559. */
  560. readonly id: number
  561. /**
  562. * 等级
  563. */
  564. readonly level: number
  565. /**
  566. * 英雄解锁技能
  567. */
  568. readonly unlockSkill: number[]
  569. /**
  570. * 解锁技能描述
  571. */
  572. readonly unlockSkillDesc: string
  573. /**
  574. * 升级消耗
  575. */
  576. readonly upgradeconsume: Common.Cost[]
  577. /**
  578. * 攻击力
  579. */
  580. readonly atk: number
  581. /**
  582. * 攻击间隔
  583. */
  584. readonly atkSpeed: number
  585. resolve(tables:Tables) {
  586. for (let _e of this.upgradeconsume) { _e?.resolve(tables); }
  587. }
  588. }
  589. /**
  590. * 英雄表.xlsx
  591. */
  592. export class TbHero {
  593. private _dataMap: Map<number, Hero>
  594. private _dataList: Hero[]
  595. constructor(_buf_: ByteBuf) {
  596. this._dataMap = new Map<number, Hero>()
  597. this._dataList = []
  598. for(let n = _buf_.ReadInt(); n > 0; n--) {
  599. let _v: Hero
  600. _v = new Hero(_buf_)
  601. this._dataList.push(_v)
  602. this._dataMap.set(_v.id, _v)
  603. }
  604. }
  605. getDataMap(): Map<number, Hero> { return this._dataMap; }
  606. getDataList(): Hero[] { return this._dataList; }
  607. get(key: number): Hero | undefined {
  608. return this._dataMap.get(key);
  609. }
  610. resolve(tables:Tables) {
  611. for(let data of this._dataList)
  612. {
  613. data.resolve(tables)
  614. }
  615. }
  616. }
  617. /**
  618. * 英雄等级表.xlsx
  619. */
  620. export class TbHeroLevel {
  621. private _dataMap: Map<number, HeroLevel>
  622. private _dataList: HeroLevel[]
  623. constructor(_buf_: ByteBuf) {
  624. this._dataMap = new Map<number, HeroLevel>()
  625. this._dataList = []
  626. for(let n = _buf_.ReadInt(); n > 0; n--) {
  627. let _v: HeroLevel
  628. _v = new HeroLevel(_buf_)
  629. this._dataList.push(_v)
  630. this._dataMap.set(_v.idx, _v)
  631. }
  632. }
  633. getDataMap(): Map<number, HeroLevel> { return this._dataMap; }
  634. getDataList(): HeroLevel[] { return this._dataList; }
  635. get(key: number): HeroLevel | undefined {
  636. return this._dataMap.get(key);
  637. }
  638. resolve(tables:Tables) {
  639. for(let data of this._dataList)
  640. {
  641. data.resolve(tables)
  642. }
  643. }
  644. }
  645. /**
  646. * ZD技能Buff.xlsx
  647. */
  648. export class TbSkillBuff {
  649. private _dataMap: Map<number, SkillBuff>
  650. private _dataList: SkillBuff[]
  651. constructor(_buf_: ByteBuf) {
  652. this._dataMap = new Map<number, SkillBuff>()
  653. this._dataList = []
  654. for(let n = _buf_.ReadInt(); n > 0; n--) {
  655. let _v: SkillBuff
  656. _v = new SkillBuff(_buf_)
  657. this._dataList.push(_v)
  658. this._dataMap.set(_v.idx, _v)
  659. }
  660. }
  661. getDataMap(): Map<number, SkillBuff> { return this._dataMap; }
  662. getDataList(): SkillBuff[] { return this._dataList; }
  663. get(key: number): SkillBuff | undefined {
  664. return this._dataMap.get(key);
  665. }
  666. resolve(tables:Tables) {
  667. for(let data of this._dataList)
  668. {
  669. data.resolve(tables)
  670. }
  671. }
  672. }
  673. /**
  674. * ZD技能表.xlsx
  675. */
  676. export class TbSkill {
  677. private _dataMap: Map<number, Skill>
  678. private _dataList: Skill[]
  679. constructor(_buf_: ByteBuf) {
  680. this._dataMap = new Map<number, Skill>()
  681. this._dataList = []
  682. for(let n = _buf_.ReadInt(); n > 0; n--) {
  683. let _v: Skill
  684. _v = new Skill(_buf_)
  685. this._dataList.push(_v)
  686. this._dataMap.set(_v.skillId, _v)
  687. }
  688. }
  689. getDataMap(): Map<number, Skill> { return this._dataMap; }
  690. getDataList(): Skill[] { return this._dataList; }
  691. get(key: number): Skill | undefined {
  692. return this._dataMap.get(key);
  693. }
  694. resolve(tables:Tables) {
  695. for(let data of this._dataList)
  696. {
  697. data.resolve(tables)
  698. }
  699. }
  700. }
  701. /**
  702. * 波数表.xlsx
  703. */
  704. export class TbWave {
  705. private _dataMap: Map<number, Wave>
  706. private _dataList: Wave[]
  707. constructor(_buf_: ByteBuf) {
  708. this._dataMap = new Map<number, Wave>()
  709. this._dataList = []
  710. for(let n = _buf_.ReadInt(); n > 0; n--) {
  711. let _v: Wave
  712. _v = new Wave(_buf_)
  713. this._dataList.push(_v)
  714. this._dataMap.set(_v.idx, _v)
  715. }
  716. }
  717. getDataMap(): Map<number, Wave> { return this._dataMap; }
  718. getDataList(): Wave[] { return this._dataList; }
  719. get(key: number): Wave | undefined {
  720. return this._dataMap.get(key);
  721. }
  722. resolve(tables:Tables) {
  723. for(let data of this._dataList)
  724. {
  725. data.resolve(tables)
  726. }
  727. }
  728. }
  729. /**
  730. * 波数奖励表.xlsx
  731. */
  732. export class TbWaveRewards {
  733. private _dataMap: Map<number, WaveRewards>
  734. private _dataList: WaveRewards[]
  735. constructor(_buf_: ByteBuf) {
  736. this._dataMap = new Map<number, WaveRewards>()
  737. this._dataList = []
  738. for(let n = _buf_.ReadInt(); n > 0; n--) {
  739. let _v: WaveRewards
  740. _v = new WaveRewards(_buf_)
  741. this._dataList.push(_v)
  742. this._dataMap.set(_v.idx, _v)
  743. }
  744. }
  745. getDataMap(): Map<number, WaveRewards> { return this._dataMap; }
  746. getDataList(): WaveRewards[] { return this._dataList; }
  747. get(key: number): WaveRewards | undefined {
  748. return this._dataMap.get(key);
  749. }
  750. resolve(tables:Tables) {
  751. for(let data of this._dataList)
  752. {
  753. data.resolve(tables)
  754. }
  755. }
  756. }
  757. /**
  758. * 道具表.xlsx
  759. */
  760. export class TbItem {
  761. private _dataMap: Map<number, Item>
  762. private _dataList: Item[]
  763. constructor(_buf_: ByteBuf) {
  764. this._dataMap = new Map<number, Item>()
  765. this._dataList = []
  766. for(let n = _buf_.ReadInt(); n > 0; n--) {
  767. let _v: Item
  768. _v = new Item(_buf_)
  769. this._dataList.push(_v)
  770. this._dataMap.set(_v.idx, _v)
  771. }
  772. }
  773. getDataMap(): Map<number, Item> { return this._dataMap; }
  774. getDataList(): Item[] { return this._dataList; }
  775. get(key: number): Item | undefined {
  776. return this._dataMap.get(key);
  777. }
  778. resolve(tables:Tables) {
  779. for(let data of this._dataList)
  780. {
  781. data.resolve(tables)
  782. }
  783. }
  784. }
  785. /**
  786. * 系统常量表.xlsx
  787. */
  788. export class TbSystem {
  789. private _dataMap: Map<string, System>
  790. private _dataList: System[]
  791. constructor(_buf_: ByteBuf) {
  792. this._dataMap = new Map<string, System>()
  793. this._dataList = []
  794. for(let n = _buf_.ReadInt(); n > 0; n--) {
  795. let _v: System
  796. _v = new System(_buf_)
  797. this._dataList.push(_v)
  798. this._dataMap.set(_v.mainKey, _v)
  799. }
  800. }
  801. getDataMap(): Map<string, System> { return this._dataMap; }
  802. getDataList(): System[] { return this._dataList; }
  803. get(key: string): System | undefined {
  804. return this._dataMap.get(key);
  805. }
  806. resolve(tables:Tables) {
  807. for(let data of this._dataList)
  808. {
  809. data.resolve(tables)
  810. }
  811. }
  812. }
  813. type ByteBufLoader = (file: string) => ByteBuf
  814. export class Tables {
  815. private _TbHero: TbHero
  816. /**
  817. * 英雄表.xlsx
  818. */
  819. get TbHero(): TbHero { return this._TbHero;}
  820. private _TbHeroLevel: TbHeroLevel
  821. /**
  822. * 英雄等级表.xlsx
  823. */
  824. get TbHeroLevel(): TbHeroLevel { return this._TbHeroLevel;}
  825. private _TbSkillBuff: TbSkillBuff
  826. /**
  827. * ZD技能Buff.xlsx
  828. */
  829. get TbSkillBuff(): TbSkillBuff { return this._TbSkillBuff;}
  830. private _TbSkill: TbSkill
  831. /**
  832. * ZD技能表.xlsx
  833. */
  834. get TbSkill(): TbSkill { return this._TbSkill;}
  835. private _TbWave: TbWave
  836. /**
  837. * 波数表.xlsx
  838. */
  839. get TbWave(): TbWave { return this._TbWave;}
  840. private _TbWaveRewards: TbWaveRewards
  841. /**
  842. * 波数奖励表.xlsx
  843. */
  844. get TbWaveRewards(): TbWaveRewards { return this._TbWaveRewards;}
  845. private _TbItem: TbItem
  846. /**
  847. * 道具表.xlsx
  848. */
  849. get TbItem(): TbItem { return this._TbItem;}
  850. private _TbSystem: TbSystem
  851. /**
  852. * 系统常量表.xlsx
  853. */
  854. get TbSystem(): TbSystem { return this._TbSystem;}
  855. static getTableNames(): string[] {
  856. let names: string[] = [];
  857. names.push('tbhero');
  858. names.push('tbherolevel');
  859. names.push('tbskillbuff');
  860. names.push('tbskill');
  861. names.push('tbwave');
  862. names.push('tbwaverewards');
  863. names.push('tbitem');
  864. names.push('tbsystem');
  865. return names;
  866. }
  867. constructor(loader: ByteBufLoader) {
  868. this._TbHero = new TbHero(loader('tbhero'))
  869. this._TbHeroLevel = new TbHeroLevel(loader('tbherolevel'))
  870. this._TbSkillBuff = new TbSkillBuff(loader('tbskillbuff'))
  871. this._TbSkill = new TbSkill(loader('tbskill'))
  872. this._TbWave = new TbWave(loader('tbwave'))
  873. this._TbWaveRewards = new TbWaveRewards(loader('tbwaverewards'))
  874. this._TbItem = new TbItem(loader('tbitem'))
  875. this._TbSystem = new TbSystem(loader('tbsystem'))
  876. this._TbHero.resolve(this)
  877. this._TbHeroLevel.resolve(this)
  878. this._TbSkillBuff.resolve(this)
  879. this._TbSkill.resolve(this)
  880. this._TbWave.resolve(this)
  881. this._TbWaveRewards.resolve(this)
  882. this._TbItem.resolve(this)
  883. this._TbSystem.resolve(this)
  884. }
  885. }