lik/ts/lik.objectmap.ts
2016-07-31 00:54:46 +02:00

26 lines
612 B
TypeScript

import * as plugins from "./lik.plugins";
/**
* allows keeping track of objects
*/
export class Objectmap {
private objectArray = [];
add(objectArg){
this.objectArray.push(objectArg);
};
remove(objectArg){
let replacmentArray = [];
for(let item of this.objectArray){
if(item !== objectArg){
replacmentArray.push(item);
}
};
this.objectArray = replacmentArray;
};
checkForObject(objectArg){
return this.objectArray.indexOf(objectArg !== -1)
};
wipe(){
this.objectArray = [];
}
}