table_idiom_order.ts 1.1 KB

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