DataBase.ts 461 B

12345678910111213141516171819
  1. import { BattleBase } from "../base/BattleBase";
  2. import { BattleUtil } from "./BattleUtil";
  3. let IDIndex = 0;
  4. //数据基类
  5. export class DataBase extends BattleBase {
  6. //唯一ID,当重复利用对象池时 同一对象不同实物时ID不同
  7. ID: number = BattleUtil.IndexID_Init;
  8. typeID: number = BattleUtil.TypeID_Init;
  9. _init() {
  10. this.ID = IDIndex++;
  11. }
  12. clear() {
  13. this.ID = BattleUtil.IndexID_Init;
  14. }
  15. }