2016-08-08 17:29:44 +02:00
|
|
|
export interface IObjectmapForEachFunction<T> {
|
|
|
|
(itemArg: T): void;
|
2016-07-31 14:36:28 +02:00
|
|
|
}
|
2016-08-08 17:29:44 +02:00
|
|
|
export interface IObjectmapFindFunction<T> {
|
|
|
|
(itemArg: T): boolean;
|
2016-08-08 16:00:14 +02:00
|
|
|
}
|
2016-07-31 00:54:46 +02:00
|
|
|
/**
|
|
|
|
* allows keeping track of objects
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
export declare class Objectmap<T> {
|
2016-07-31 00:54:46 +02:00
|
|
|
private objectArray;
|
2016-08-07 18:08:52 +02:00
|
|
|
/**
|
|
|
|
* returns a new instance
|
|
|
|
*/
|
|
|
|
constructor();
|
2016-07-31 14:36:28 +02:00
|
|
|
/**
|
|
|
|
* add object to Objectmap
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
add(objectArg: T): void;
|
2016-07-31 14:36:28 +02:00
|
|
|
/**
|
|
|
|
* remove object from Objectmap
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
remove(objectArg: T): void;
|
2016-07-31 14:36:28 +02:00
|
|
|
/**
|
|
|
|
* check if object is in Objectmap
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
checkForObject(objectArg: T): boolean;
|
2016-08-08 16:00:14 +02:00
|
|
|
/**
|
|
|
|
* find object
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
find(findFunction: IObjectmapFindFunction<T>): T;
|
2016-07-31 14:36:28 +02:00
|
|
|
/**
|
|
|
|
* run function for each item in Objectmap
|
|
|
|
*/
|
2016-08-08 17:29:44 +02:00
|
|
|
forEach(functionArg: IObjectmapForEachFunction<T>): void;
|
2016-07-31 14:36:28 +02:00
|
|
|
/**
|
|
|
|
* wipe Objectmap
|
|
|
|
*/
|
2016-07-31 00:54:46 +02:00
|
|
|
wipe(): void;
|
|
|
|
}
|