schema.ts 21 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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 SkillBuff {
  220. constructor(_buf_: ByteBuf) {
  221. this.idx = _buf_.ReadInt()
  222. this.remark = _buf_.ReadString()
  223. this.type = _buf_.ReadInt()
  224. this.parameters = _buf_.ReadString()
  225. this.probability = _buf_.ReadInt()
  226. this.triggerCondition = _buf_.ReadString()
  227. this.effectType = _buf_.ReadInt()
  228. this.duration = _buf_.ReadInt()
  229. this.overlapTimes = _buf_.ReadInt()
  230. this.uniqueGain = _buf_.ReadBool()
  231. this.halo = _buf_.ReadBool()
  232. this.attributes = _buf_.ReadString()
  233. this.mixBufficon = _buf_.ReadInt()
  234. this.skillShowId = _buf_.ReadInt()
  235. this.floatingTextId = _buf_.ReadInt()
  236. }
  237. /**
  238. * buffid
  239. */
  240. readonly idx: number
  241. /**
  242. * 备注
  243. */
  244. readonly remark: string
  245. /**
  246. * buff类型
  247. */
  248. readonly type: number
  249. /**
  250. * buff参数
  251. */
  252. readonly parameters: string
  253. /**
  254. * 触发概率
  255. */
  256. readonly probability: number
  257. /**
  258. * 触发条件
  259. */
  260. readonly triggerCondition: string
  261. /**
  262. * 效果类型
  263. */
  264. readonly effectType: number
  265. /**
  266. * 持续时间
  267. */
  268. readonly duration: number
  269. /**
  270. * 叠加次数
  271. */
  272. readonly overlapTimes: number
  273. /**
  274. * 唯一增益
  275. */
  276. readonly uniqueGain: boolean
  277. /**
  278. * 是否是光环
  279. */
  280. readonly halo: boolean
  281. /**
  282. * buff增加的属性
  283. */
  284. readonly attributes: string
  285. /**
  286. * 是否合并
  287. */
  288. readonly mixBufficon: number
  289. /**
  290. * 效果id
  291. */
  292. readonly skillShowId: number
  293. /**
  294. * 飘字id
  295. */
  296. readonly floatingTextId: number
  297. resolve(tables:Tables) {
  298. }
  299. }
  300. export class WaveRewards {
  301. constructor(_buf_: ByteBuf) {
  302. this.idx = _buf_.ReadInt()
  303. this.waveMin = _buf_.ReadInt()
  304. this.waveMax = _buf_.ReadInt()
  305. this.level = _buf_.ReadInt()
  306. { 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);}}
  307. }
  308. /**
  309. * idx
  310. */
  311. readonly idx: number
  312. /**
  313. * 波数下限
  314. */
  315. readonly waveMin: number
  316. /**
  317. * 波数上限
  318. */
  319. readonly waveMax: number
  320. /**
  321. * 难度
  322. */
  323. readonly level: number
  324. /**
  325. * 奖励列表
  326. */
  327. readonly rewards: Common.Reward[]
  328. resolve(tables:Tables) {
  329. for (let _e of this.rewards) { _e?.resolve(tables); }
  330. }
  331. }
  332. export class System {
  333. constructor(_buf_: ByteBuf) {
  334. this.idx = _buf_.ReadInt()
  335. this.mainKey = _buf_.ReadString()
  336. this.value = _buf_.ReadString()
  337. }
  338. /**
  339. * IDX
  340. */
  341. readonly idx: number
  342. /**
  343. * 常量主键
  344. */
  345. readonly mainKey: string
  346. /**
  347. * 常量值
  348. */
  349. readonly value: string
  350. resolve(tables:Tables) {
  351. }
  352. }
  353. export class HeroLevel {
  354. constructor(_buf_: ByteBuf) {
  355. this.idx = _buf_.ReadInt()
  356. this.id = _buf_.ReadInt()
  357. this.level = _buf_.ReadInt()
  358. { 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);}}
  359. this.unlockSkillDesc = _buf_.ReadString()
  360. { 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);}}
  361. this.atk = _buf_.ReadInt()
  362. this.atkSpeed = _buf_.ReadInt()
  363. }
  364. /**
  365. * 序號
  366. */
  367. readonly idx: number
  368. /**
  369. * 英雄ID
  370. */
  371. readonly id: number
  372. /**
  373. * 等级
  374. */
  375. readonly level: number
  376. /**
  377. * 英雄解锁技能
  378. */
  379. readonly unlockSkill: number[]
  380. /**
  381. * 解锁技能描述
  382. */
  383. readonly unlockSkillDesc: string
  384. /**
  385. * 升级消耗
  386. */
  387. readonly upgradeconsume: Common.Cost[]
  388. /**
  389. * 攻击力
  390. */
  391. readonly atk: number
  392. /**
  393. * 攻击速度
  394. */
  395. readonly atkSpeed: number
  396. resolve(tables:Tables) {
  397. for (let _e of this.upgradeconsume) { _e?.resolve(tables); }
  398. }
  399. }
  400. export class Item {
  401. constructor(_buf_: ByteBuf) {
  402. this.idx = _buf_.ReadInt()
  403. this.type = _buf_.ReadInt()
  404. this.name = _buf_.ReadString()
  405. }
  406. /**
  407. * 道具ID
  408. */
  409. readonly idx: number
  410. /**
  411. * 类型
  412. */
  413. readonly type: number
  414. /**
  415. * 道具名
  416. */
  417. readonly name: string
  418. resolve(tables:Tables) {
  419. }
  420. }
  421. export class Wave {
  422. constructor(_buf_: ByteBuf) {
  423. this.idx = _buf_.ReadInt()
  424. this.waveIndex = _buf_.ReadInt()
  425. this.level = _buf_.ReadInt()
  426. this.model = _buf_.ReadInt()
  427. this.counter = _buf_.ReadInt()
  428. this.hp = _buf_.ReadInt()
  429. this.speed = _buf_.ReadInt()
  430. this.gap = _buf_.ReadInt()
  431. this.isboss = _buf_.ReadInt()
  432. this.perAddCoid = _buf_.ReadInt()
  433. this.perAddGem = _buf_.ReadInt()
  434. }
  435. /**
  436. * 唯一id
  437. */
  438. readonly idx: number
  439. /**
  440. * 波数
  441. */
  442. readonly waveIndex: number
  443. /**
  444. * 难度
  445. */
  446. readonly level: number
  447. /**
  448. * 怪物模型
  449. */
  450. readonly model: number
  451. /**
  452. * 数量
  453. */
  454. readonly counter: number
  455. /**
  456. * 血量
  457. */
  458. readonly hp: number
  459. /**
  460. * 速度
  461. */
  462. readonly speed: number
  463. /**
  464. * 间距
  465. */
  466. readonly gap: number
  467. /**
  468. * 是否是boss
  469. */
  470. readonly isboss: number
  471. /**
  472. * 每只怪增加局内金币
  473. */
  474. readonly perAddCoid: number
  475. /**
  476. * 每只怪增加局内宝石
  477. */
  478. readonly perAddGem: number
  479. resolve(tables:Tables) {
  480. }
  481. }
  482. export class Skill {
  483. constructor(_buf_: ByteBuf) {
  484. this.idx = _buf_.ReadInt()
  485. this.remark = _buf_.ReadString()
  486. this.skillId = _buf_.ReadInt()
  487. this.level = _buf_.ReadInt()
  488. this.skillType = _buf_.ReadInt()
  489. this.cd = _buf_.ReadInt()
  490. this.range = _buf_.ReadInt()
  491. this.triggerCondition = _buf_.ReadString()
  492. this.effects = _buf_.ReadString()
  493. this.buffId = _buf_.ReadString()
  494. this.skillName = _buf_.ReadString()
  495. this.desc = _buf_.ReadString()
  496. this.conflictSkillId = _buf_.ReadInt()
  497. }
  498. /**
  499. * 主键id
  500. */
  501. readonly idx: number
  502. /**
  503. * 备注
  504. */
  505. readonly remark: string
  506. /**
  507. * 技能ID
  508. */
  509. readonly skillId: number
  510. /**
  511. * 等级
  512. */
  513. readonly level: number
  514. /**
  515. * 类型
  516. */
  517. readonly skillType: number
  518. /**
  519. * 冷却时间
  520. */
  521. readonly cd: number
  522. /**
  523. * 攻击距离
  524. */
  525. readonly range: number
  526. /**
  527. * 技能触发条件
  528. */
  529. readonly triggerCondition: string
  530. /**
  531. * 效果列表
  532. */
  533. readonly effects: string
  534. /**
  535. * buff
  536. */
  537. readonly buffId: string
  538. /**
  539. * 技能名字
  540. */
  541. readonly skillName: string
  542. /**
  543. * 技能描述
  544. */
  545. readonly desc: string
  546. /**
  547. * 冲突的技能id
  548. */
  549. readonly conflictSkillId: number
  550. resolve(tables:Tables) {
  551. }
  552. }
  553. export class Hero {
  554. constructor(_buf_: ByteBuf) {
  555. this.id = _buf_.ReadInt()
  556. this.quality = _buf_.ReadInt()
  557. this.attacktype = _buf_.ReadInt()
  558. this.name = _buf_.ReadString()
  559. { 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);}}
  560. }
  561. /**
  562. * 英雄ID
  563. */
  564. readonly id: number
  565. /**
  566. * 品质
  567. */
  568. readonly quality: Quality
  569. /**
  570. * 攻击类型
  571. */
  572. readonly attacktype: AttackType
  573. /**
  574. * 名字
  575. */
  576. readonly name: string
  577. /**
  578. * 技能列表
  579. */
  580. readonly skills: number[]
  581. resolve(tables:Tables) {
  582. }
  583. }
  584. /**
  585. * 英雄表.xlsx
  586. */
  587. export class TbHero {
  588. private _dataMap: Map<number, Hero>
  589. private _dataList: Hero[]
  590. constructor(_buf_: ByteBuf) {
  591. this._dataMap = new Map<number, Hero>()
  592. this._dataList = []
  593. for(let n = _buf_.ReadInt(); n > 0; n--) {
  594. let _v: Hero
  595. _v = new Hero(_buf_)
  596. this._dataList.push(_v)
  597. this._dataMap.set(_v.id, _v)
  598. }
  599. }
  600. getDataMap(): Map<number, Hero> { return this._dataMap; }
  601. getDataList(): Hero[] { return this._dataList; }
  602. get(key: number): Hero | undefined {
  603. return this._dataMap.get(key);
  604. }
  605. resolve(tables:Tables) {
  606. for(let data of this._dataList)
  607. {
  608. data.resolve(tables)
  609. }
  610. }
  611. }
  612. /**
  613. * 英雄等级表.xlsx
  614. */
  615. export class TbHeroLevel {
  616. private _dataMap: Map<number, HeroLevel>
  617. private _dataList: HeroLevel[]
  618. constructor(_buf_: ByteBuf) {
  619. this._dataMap = new Map<number, HeroLevel>()
  620. this._dataList = []
  621. for(let n = _buf_.ReadInt(); n > 0; n--) {
  622. let _v: HeroLevel
  623. _v = new HeroLevel(_buf_)
  624. this._dataList.push(_v)
  625. this._dataMap.set(_v.idx, _v)
  626. }
  627. }
  628. getDataMap(): Map<number, HeroLevel> { return this._dataMap; }
  629. getDataList(): HeroLevel[] { return this._dataList; }
  630. get(key: number): HeroLevel | undefined {
  631. return this._dataMap.get(key);
  632. }
  633. resolve(tables:Tables) {
  634. for(let data of this._dataList)
  635. {
  636. data.resolve(tables)
  637. }
  638. }
  639. }
  640. /**
  641. * ZD技能Buff.xlsx
  642. */
  643. export class TbSkillBuff {
  644. private _dataMap: Map<number, SkillBuff>
  645. private _dataList: SkillBuff[]
  646. constructor(_buf_: ByteBuf) {
  647. this._dataMap = new Map<number, SkillBuff>()
  648. this._dataList = []
  649. for(let n = _buf_.ReadInt(); n > 0; n--) {
  650. let _v: SkillBuff
  651. _v = new SkillBuff(_buf_)
  652. this._dataList.push(_v)
  653. this._dataMap.set(_v.idx, _v)
  654. }
  655. }
  656. getDataMap(): Map<number, SkillBuff> { return this._dataMap; }
  657. getDataList(): SkillBuff[] { return this._dataList; }
  658. get(key: number): SkillBuff | undefined {
  659. return this._dataMap.get(key);
  660. }
  661. resolve(tables:Tables) {
  662. for(let data of this._dataList)
  663. {
  664. data.resolve(tables)
  665. }
  666. }
  667. }
  668. /**
  669. * ZD技能表.xlsx
  670. */
  671. export class TbSkill {
  672. private _dataList: Skill[]
  673. constructor(_buf_: ByteBuf) {
  674. this._dataList = []
  675. for(let n = _buf_.ReadInt(); n > 0; n--) {
  676. let _v: Skill
  677. _v = new Skill(_buf_)
  678. this._dataList.push(_v)
  679. }
  680. }
  681. getDataList(): Skill[] { return this._dataList }
  682. get(index: number): Skill | undefined { return this._dataList[index] }
  683. resolve(tables:Tables) {
  684. for(let data of this._dataList)
  685. {
  686. data.resolve(tables)
  687. }
  688. }
  689. }
  690. /**
  691. * 波数表.xlsx
  692. */
  693. export class TbWave {
  694. private _dataMap: Map<number, Wave>
  695. private _dataList: Wave[]
  696. constructor(_buf_: ByteBuf) {
  697. this._dataMap = new Map<number, Wave>()
  698. this._dataList = []
  699. for(let n = _buf_.ReadInt(); n > 0; n--) {
  700. let _v: Wave
  701. _v = new Wave(_buf_)
  702. this._dataList.push(_v)
  703. this._dataMap.set(_v.idx, _v)
  704. }
  705. }
  706. getDataMap(): Map<number, Wave> { return this._dataMap; }
  707. getDataList(): Wave[] { return this._dataList; }
  708. get(key: number): Wave | undefined {
  709. return this._dataMap.get(key);
  710. }
  711. resolve(tables:Tables) {
  712. for(let data of this._dataList)
  713. {
  714. data.resolve(tables)
  715. }
  716. }
  717. }
  718. /**
  719. * 波数奖励表.xlsx
  720. */
  721. export class TbWaveRewards {
  722. private _dataMap: Map<number, WaveRewards>
  723. private _dataList: WaveRewards[]
  724. constructor(_buf_: ByteBuf) {
  725. this._dataMap = new Map<number, WaveRewards>()
  726. this._dataList = []
  727. for(let n = _buf_.ReadInt(); n > 0; n--) {
  728. let _v: WaveRewards
  729. _v = new WaveRewards(_buf_)
  730. this._dataList.push(_v)
  731. this._dataMap.set(_v.idx, _v)
  732. }
  733. }
  734. getDataMap(): Map<number, WaveRewards> { return this._dataMap; }
  735. getDataList(): WaveRewards[] { return this._dataList; }
  736. get(key: number): WaveRewards | undefined {
  737. return this._dataMap.get(key);
  738. }
  739. resolve(tables:Tables) {
  740. for(let data of this._dataList)
  741. {
  742. data.resolve(tables)
  743. }
  744. }
  745. }
  746. /**
  747. * 道具表.xlsx
  748. */
  749. export class TbItem {
  750. private _dataMap: Map<number, Item>
  751. private _dataList: Item[]
  752. constructor(_buf_: ByteBuf) {
  753. this._dataMap = new Map<number, Item>()
  754. this._dataList = []
  755. for(let n = _buf_.ReadInt(); n > 0; n--) {
  756. let _v: Item
  757. _v = new Item(_buf_)
  758. this._dataList.push(_v)
  759. this._dataMap.set(_v.idx, _v)
  760. }
  761. }
  762. getDataMap(): Map<number, Item> { return this._dataMap; }
  763. getDataList(): Item[] { return this._dataList; }
  764. get(key: number): Item | undefined {
  765. return this._dataMap.get(key);
  766. }
  767. resolve(tables:Tables) {
  768. for(let data of this._dataList)
  769. {
  770. data.resolve(tables)
  771. }
  772. }
  773. }
  774. /**
  775. * 系统常量表.xlsx
  776. */
  777. export class TbSystem {
  778. private _dataMap: Map<string, System>
  779. private _dataList: System[]
  780. constructor(_buf_: ByteBuf) {
  781. this._dataMap = new Map<string, System>()
  782. this._dataList = []
  783. for(let n = _buf_.ReadInt(); n > 0; n--) {
  784. let _v: System
  785. _v = new System(_buf_)
  786. this._dataList.push(_v)
  787. this._dataMap.set(_v.mainKey, _v)
  788. }
  789. }
  790. getDataMap(): Map<string, System> { return this._dataMap; }
  791. getDataList(): System[] { return this._dataList; }
  792. get(key: string): System | undefined {
  793. return this._dataMap.get(key);
  794. }
  795. resolve(tables:Tables) {
  796. for(let data of this._dataList)
  797. {
  798. data.resolve(tables)
  799. }
  800. }
  801. }
  802. type ByteBufLoader = (file: string) => ByteBuf
  803. export class Tables {
  804. private _TbHero: TbHero
  805. /**
  806. * 英雄表.xlsx
  807. */
  808. get TbHero(): TbHero { return this._TbHero;}
  809. private _TbHeroLevel: TbHeroLevel
  810. /**
  811. * 英雄等级表.xlsx
  812. */
  813. get TbHeroLevel(): TbHeroLevel { return this._TbHeroLevel;}
  814. private _TbSkillBuff: TbSkillBuff
  815. /**
  816. * ZD技能Buff.xlsx
  817. */
  818. get TbSkillBuff(): TbSkillBuff { return this._TbSkillBuff;}
  819. private _TbSkill: TbSkill
  820. /**
  821. * ZD技能表.xlsx
  822. */
  823. get TbSkill(): TbSkill { return this._TbSkill;}
  824. private _TbWave: TbWave
  825. /**
  826. * 波数表.xlsx
  827. */
  828. get TbWave(): TbWave { return this._TbWave;}
  829. private _TbWaveRewards: TbWaveRewards
  830. /**
  831. * 波数奖励表.xlsx
  832. */
  833. get TbWaveRewards(): TbWaveRewards { return this._TbWaveRewards;}
  834. private _TbItem: TbItem
  835. /**
  836. * 道具表.xlsx
  837. */
  838. get TbItem(): TbItem { return this._TbItem;}
  839. private _TbSystem: TbSystem
  840. /**
  841. * 系统常量表.xlsx
  842. */
  843. get TbSystem(): TbSystem { return this._TbSystem;}
  844. static getTableNames(): string[] {
  845. let names: string[] = [];
  846. names.push('tbhero');
  847. names.push('tbherolevel');
  848. names.push('tbskillbuff');
  849. names.push('tbskill');
  850. names.push('tbwave');
  851. names.push('tbwaverewards');
  852. names.push('tbitem');
  853. names.push('tbsystem');
  854. return names;
  855. }
  856. constructor(loader: ByteBufLoader) {
  857. this._TbHero = new TbHero(loader('tbhero'))
  858. this._TbHeroLevel = new TbHeroLevel(loader('tbherolevel'))
  859. this._TbSkillBuff = new TbSkillBuff(loader('tbskillbuff'))
  860. this._TbSkill = new TbSkill(loader('tbskill'))
  861. this._TbWave = new TbWave(loader('tbwave'))
  862. this._TbWaveRewards = new TbWaveRewards(loader('tbwaverewards'))
  863. this._TbItem = new TbItem(loader('tbitem'))
  864. this._TbSystem = new TbSystem(loader('tbsystem'))
  865. this._TbHero.resolve(this)
  866. this._TbHeroLevel.resolve(this)
  867. this._TbSkillBuff.resolve(this)
  868. this._TbSkill.resolve(this)
  869. this._TbWave.resolve(this)
  870. this._TbWaveRewards.resolve(this)
  871. this._TbItem.resolve(this)
  872. this._TbSystem.resolve(this)
  873. }
  874. }