lik/ts/lik.looptracker.ts

24 lines
493 B
TypeScript
Raw Normal View History

2022-05-27 15:53:02 +00:00
import * as plugins from './lik.plugins.js';
2017-07-05 12:29:08 +00:00
2022-05-27 15:53:02 +00:00
import { ObjectMap } from './lik.objectmap.js';
2017-07-05 12:29:08 +00:00
export class LoopTracker<T> {
referenceObjectMap = new ObjectMap<any>();
constructor() {
2017-07-05 12:29:08 +00:00
// 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;
}
2017-07-05 12:29:08 +00:00
}
}