schema.ts 12 KB

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