schema.ts 21 KB

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