table_idiom.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { _decorator, Component, Node } from 'cc';
  2. import { TableUtil } from './TableUtil';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('table_idiom')
  5. export class table_idiom {
  6. static readonly TableName: string = "idiom";
  7. static readonly IdList: number[]=[0,1,2,3,4,5,6,7,8,9,10];
  8. static get(id: number): table_idiom { return TableUtil.getTable(table_idiom, id) };
  9. static getList(): table_idiom[] { return TableUtil.getTables(table_idiom,2052) };
  10. private data: any;
  11. init(id: number) {
  12. var table = TableUtil.get(table_idiom.TableName);
  13. this.data = table[id];
  14. if (!this.data) console.error("配置表" + table_idiom.TableName + "没有ID:" + id);
  15. this.id = id;
  16. }
  17. /** 编号【KEY】 */
  18. id: number = 0;
  19. get idiom():string { return this.data.idiom; }
  20. get idiom_type():string { return this.data.idiom_type; }
  21. get difficulty():string { return this.data.difficulty; }
  22. get piece_1_word():string { return this.data.piece_1_word; }
  23. get piece_2_word ():string { return this.data.piece_2_word; }
  24. }