schema.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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 class HeroLevel {
  206. constructor(_buf_: ByteBuf) {
  207. this.id = _buf_.ReadInt()
  208. this.level = _buf_.ReadInt()
  209. { 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);}}
  210. this.unlockSkillDesc = _buf_.ReadString()
  211. this.atk = _buf_.ReadInt()
  212. this.atkSpeed = _buf_.ReadInt()
  213. }
  214. /**
  215. * 英雄ID
  216. */
  217. readonly id: number
  218. /**
  219. * 等级
  220. */
  221. readonly level: number
  222. /**
  223. * 英雄解锁技能
  224. */
  225. readonly unlockSkill: number[]
  226. /**
  227. * 解锁技能描述
  228. */
  229. readonly unlockSkillDesc: string
  230. /**
  231. * 攻击力
  232. */
  233. readonly atk: number
  234. /**
  235. * 攻击速度
  236. */
  237. readonly atkSpeed: number
  238. resolve(tables:Tables) {
  239. }
  240. }
  241. export class Hero {
  242. constructor(_buf_: ByteBuf) {
  243. this.id = _buf_.ReadInt()
  244. this.quality = _buf_.ReadInt()
  245. this.attacktype = _buf_.ReadInt()
  246. this.name = _buf_.ReadString()
  247. { 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);}}
  248. }
  249. /**
  250. * 英雄ID
  251. */
  252. readonly id: number
  253. /**
  254. * 品质
  255. */
  256. readonly quality: Hero.Quality
  257. /**
  258. * 攻击类型
  259. */
  260. readonly attacktype: Hero.AttackType
  261. /**
  262. * 名字
  263. */
  264. readonly name: string
  265. /**
  266. * 技能列表
  267. */
  268. readonly skills: number[]
  269. resolve(tables:Tables) {
  270. }
  271. }
  272. export class Skill {
  273. constructor(_buf_: ByteBuf) {
  274. this.idx = _buf_.ReadInt()
  275. this.remark = _buf_.ReadString()
  276. this.skillId = _buf_.ReadInt()
  277. this.level = _buf_.ReadInt()
  278. this.skillType = _buf_.ReadInt()
  279. this.cd = _buf_.ReadInt()
  280. this.triggerCondition = _buf_.ReadString()
  281. this.effects = _buf_.ReadString()
  282. this.buffId = _buf_.ReadString()
  283. this.skillName = _buf_.ReadString()
  284. this.desc = _buf_.ReadString()
  285. this.conflictSkillId = _buf_.ReadInt()
  286. }
  287. /**
  288. * 主键id
  289. */
  290. readonly idx: number
  291. /**
  292. * 备注
  293. */
  294. readonly remark: string
  295. /**
  296. * 技能ID
  297. */
  298. readonly skillId: number
  299. /**
  300. * 等级
  301. */
  302. readonly level: number
  303. /**
  304. * 类型
  305. */
  306. readonly skillType: number
  307. /**
  308. * 冷却时间
  309. */
  310. readonly cd: number
  311. /**
  312. * 技能触发条件
  313. */
  314. readonly triggerCondition: string
  315. /**
  316. * 效果列表
  317. */
  318. readonly effects: string
  319. /**
  320. * buff
  321. */
  322. readonly buffId: string
  323. /**
  324. * 技能名字
  325. */
  326. readonly skillName: string
  327. /**
  328. * 技能描述
  329. */
  330. readonly desc: string
  331. /**
  332. * 冲突的技能id
  333. */
  334. readonly conflictSkillId: number
  335. resolve(tables:Tables) {
  336. }
  337. }
  338. export class SkillBuff {
  339. constructor(_buf_: ByteBuf) {
  340. this.idx = _buf_.ReadInt()
  341. this.remark = _buf_.ReadString()
  342. this.type = _buf_.ReadInt()
  343. this.parameters = _buf_.ReadString()
  344. this.probability = _buf_.ReadInt()
  345. this.triggerCondition = _buf_.ReadString()
  346. this.effectType = _buf_.ReadInt()
  347. this.duration = _buf_.ReadInt()
  348. this.overlapTimes = _buf_.ReadInt()
  349. this.uniqueGain = _buf_.ReadBool()
  350. this.halo = _buf_.ReadBool()
  351. this.attributes = _buf_.ReadString()
  352. this.mixBufficon = _buf_.ReadInt()
  353. this.skillShowId = _buf_.ReadInt()
  354. this.floatingTextId = _buf_.ReadInt()
  355. }
  356. /**
  357. * buffid
  358. */
  359. readonly idx: number
  360. /**
  361. * 备注
  362. */
  363. readonly remark: string
  364. /**
  365. * buff类型
  366. */
  367. readonly type: number
  368. /**
  369. * buff参数
  370. */
  371. readonly parameters: string
  372. /**
  373. * 触发概率
  374. */
  375. readonly probability: number
  376. /**
  377. * 触发条件
  378. */
  379. readonly triggerCondition: string
  380. /**
  381. * 效果类型
  382. */
  383. readonly effectType: number
  384. /**
  385. * 持续时间
  386. */
  387. readonly duration: number
  388. /**
  389. * 叠加次数
  390. */
  391. readonly overlapTimes: number
  392. /**
  393. * 唯一增益
  394. */
  395. readonly uniqueGain: boolean
  396. /**
  397. * 是否是光环
  398. */
  399. readonly halo: boolean
  400. /**
  401. * buff增加的属性
  402. */
  403. readonly attributes: string
  404. /**
  405. * 是否合并
  406. */
  407. readonly mixBufficon: number
  408. /**
  409. * 效果id
  410. */
  411. readonly skillShowId: number
  412. /**
  413. * 飘字id
  414. */
  415. readonly floatingTextId: number
  416. resolve(tables:Tables) {
  417. }
  418. }
  419. /**
  420. * 英雄表.xlsx
  421. */
  422. export class TbHero {
  423. private _dataMap: Map<number, Hero>
  424. private _dataList: Hero[]
  425. constructor(_buf_: ByteBuf) {
  426. this._dataMap = new Map<number, Hero>()
  427. this._dataList = []
  428. for(let n = _buf_.ReadInt(); n > 0; n--) {
  429. let _v: Hero
  430. _v = new Hero(_buf_)
  431. this._dataList.push(_v)
  432. this._dataMap.set(_v.id, _v)
  433. }
  434. }
  435. getDataMap(): Map<number, Hero> { return this._dataMap; }
  436. getDataList(): Hero[] { return this._dataList; }
  437. get(key: number): Hero | undefined {
  438. return this._dataMap.get(key);
  439. }
  440. resolve(tables:Tables) {
  441. for(let data of this._dataList)
  442. {
  443. data.resolve(tables)
  444. }
  445. }
  446. }
  447. /**
  448. * 英雄等级表.xlsx
  449. */
  450. export class TbHeroLevel {
  451. private _dataList: HeroLevel[]
  452. constructor(_buf_: ByteBuf) {
  453. this._dataList = []
  454. for(let n = _buf_.ReadInt(); n > 0; n--) {
  455. let _v: HeroLevel
  456. _v = new HeroLevel(_buf_)
  457. this._dataList.push(_v)
  458. }
  459. }
  460. getDataList(): HeroLevel[] { return this._dataList }
  461. get(index: number): HeroLevel | undefined { return this._dataList[index] }
  462. resolve(tables:Tables) {
  463. for(let data of this._dataList)
  464. {
  465. data.resolve(tables)
  466. }
  467. }
  468. }
  469. /**
  470. * ZD技能Buff.xlsx
  471. */
  472. export class TbSkillBuff {
  473. private _dataMap: Map<number, SkillBuff>
  474. private _dataList: SkillBuff[]
  475. constructor(_buf_: ByteBuf) {
  476. this._dataMap = new Map<number, SkillBuff>()
  477. this._dataList = []
  478. for(let n = _buf_.ReadInt(); n > 0; n--) {
  479. let _v: SkillBuff
  480. _v = new SkillBuff(_buf_)
  481. this._dataList.push(_v)
  482. this._dataMap.set(_v.idx, _v)
  483. }
  484. }
  485. getDataMap(): Map<number, SkillBuff> { return this._dataMap; }
  486. getDataList(): SkillBuff[] { return this._dataList; }
  487. get(key: number): SkillBuff | undefined {
  488. return this._dataMap.get(key);
  489. }
  490. resolve(tables:Tables) {
  491. for(let data of this._dataList)
  492. {
  493. data.resolve(tables)
  494. }
  495. }
  496. }
  497. /**
  498. * ZD技能表.xlsx
  499. */
  500. export class TbSkill {
  501. private _dataList: Skill[]
  502. constructor(_buf_: ByteBuf) {
  503. this._dataList = []
  504. for(let n = _buf_.ReadInt(); n > 0; n--) {
  505. let _v: Skill
  506. _v = new Skill(_buf_)
  507. this._dataList.push(_v)
  508. }
  509. }
  510. getDataList(): Skill[] { return this._dataList }
  511. get(index: number): Skill | undefined { return this._dataList[index] }
  512. resolve(tables:Tables) {
  513. for(let data of this._dataList)
  514. {
  515. data.resolve(tables)
  516. }
  517. }
  518. }
  519. type ByteBufLoader = (file: string) => ByteBuf
  520. export class Tables {
  521. private _TbHero: TbHero
  522. /**
  523. * 英雄表.xlsx
  524. */
  525. get TbHero(): TbHero { return this._TbHero;}
  526. private _TbHeroLevel: TbHeroLevel
  527. /**
  528. * 英雄等级表.xlsx
  529. */
  530. get TbHeroLevel(): TbHeroLevel { return this._TbHeroLevel;}
  531. private _TbSkillBuff: TbSkillBuff
  532. /**
  533. * ZD技能Buff.xlsx
  534. */
  535. get TbSkillBuff(): TbSkillBuff { return this._TbSkillBuff;}
  536. private _TbSkill: TbSkill
  537. /**
  538. * ZD技能表.xlsx
  539. */
  540. get TbSkill(): TbSkill { return this._TbSkill;}
  541. static getTableNames(): string[] {
  542. let names: string[] = [];
  543. names.push('tbhero');
  544. names.push('tbherolevel');
  545. names.push('tbskillbuff');
  546. names.push('tbskill');
  547. return names;
  548. }
  549. constructor(loader: ByteBufLoader) {
  550. this._TbHero = new TbHero(loader('tbhero'))
  551. this._TbHeroLevel = new TbHeroLevel(loader('tbherolevel'))
  552. this._TbSkillBuff = new TbSkillBuff(loader('tbskillbuff'))
  553. this._TbSkill = new TbSkill(loader('tbskill'))
  554. this._TbHero.resolve(this)
  555. this._TbHeroLevel.resolve(this)
  556. this._TbSkillBuff.resolve(this)
  557. this._TbSkill.resolve(this)
  558. }
  559. }