Add more flexibility to draw-time object filtering

The `_drawThese` call now takes both a list of Drawable IDs for positive
filtering and a filter function for negative filtering.
This commit is contained in:
Christopher Willis-Ford 2016-06-01 16:17:56 -07:00
parent 137e4a642e
commit 25d8148ec4
2 changed files with 24 additions and 7 deletions

View file

@ -95,6 +95,12 @@ Drawable._effectConverter = {
}
};
/**
* @callback Drawable~idFilterFunc
* @param {int} drawableID The ID to filter.
* @return {bool} True if the ID passes the filter, otherwise false.
*/
/**
* An invalid Drawable ID which can be used to signify absence, etc.
* @type {int}
@ -107,6 +113,11 @@ Drawable.NONE = -1;
*/
Drawable.EFFECTS = Object.keys(Drawable._effectConverter);
/**
* The available draw modes.
* @readonly
* @enum {string}
*/
Drawable.DRAW_MODE = {
default: 'default',
pick: 'pick'