public void DefineClassTraits(IEnumerable <AbcInstance> set, Predicate <AbcInstance> filter) { foreach (var instance in set) { //NOTE: Ignore instances initilized by other scripts if (instance.Script != null && instance.Script != this) { continue; } var klass = instance.Class; if (filter != null && filter(instance)) { continue; } Traits.AddClass(klass); } }