123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { ItemEnum } from "../common/InterfaceAddEnum";
- import { EquipManager } from "../manager/EquipManager";
- export interface Equip {
- id: string;
- count: number;
- exp: number;
- star: number;
- wear: boolean;
- type: ItemEnum;
- fightForce: number
- conf: {};
- }
- class Data {
- private _bagData: { [id: string]: Equip } = {};
- set bagData(data: { [id: string]: Equip }) {
- this._bagData = data;
- }
- get bagData(): { [id: string]: Equip } {
- return this._bagData;
- }
- init(): void {
- this.reset();
- }
- reset(): void {
- this._bagData = {};
- }
- purge(): void {
- this.reset();
- }
- addDataByKey(key,data) {
- this._bagData[key] = data;
- }
- removeDataByKey(key) {
- if (this._bagData.hasOwnProperty(key)) {
- delete this._bagData[key];
- }
- }
- }
- export let EquipData = new Data;
|