bool accepts(Event event) => event is T && !event.isCanceled && (type == null || type == event.type);