lik/ts/lik.looptracker.ts
2022-05-27 17:53:02 +02:00

24 lines
493 B
TypeScript

import * as plugins from './lik.plugins.js';
import { ObjectMap } from './lik.objectmap.js';
export class LoopTracker<T> {
referenceObjectMap = new ObjectMap<any>();
constructor() {
// nothing here
}
/**
* checks and tracks an object
* @param objectArg
*/
checkAndTrack(objectArg: T): boolean {
if (!this.referenceObjectMap.checkForObject(objectArg)) {
this.referenceObjectMap.add(objectArg);
return true;
} else {
return false;
}
}
}