nape.callbacks.OptionType

type
class
OptionType representing matching behaviour for Listeners.

An object's set of CbType's 'matches' against an OptionType iff. the OptionType's includes list intersects the object's set of CbTypes and the OptionType's excludes list 'does not' intersect the object's set of CbTypes.
option = new OptionType([A, B], [C, D]);
obj.cbTypes = [] // => does not match option.
obj.cbTypes = [A] // => matches the option
obj.cbTypes = [A, C] // => does not match option.
The optionType's includes and excludes list are managed to be always disjoint: The action of including an already excluded type serves to remove it from the excludes list, equalliy excluding an already included type serves to remove it from the includes list.
var option = new OptionType();
option.including(A); // option = {[A]:[]}
option.excluding(A); // option = {[]:[]}
option.excluding(A); // option = {[]:[A]}
option.including(A); // option = {[A]:[]}

Constructor

function new(includes:Dynamic = null, excludes:Dynamic = null)
+ Construct a new OptionType.

Instance Properties

readonly var excludes : CbTypeList = []

+ List of excluded CbTypes.

readonly var includes : CbTypeList = []

+ List of included CbTypes.

Instance Methods

function excluding(excludes:Dynamic = null):OptionType

+ Append set of types to excludes list.

function including(includes:Dynamic = null):OptionType

+ Append set of types to includes list.