op | The operator identifier. |
QueryFilterOperator The added, or existing, QueryFilterOperator.
Add a custom filter operator specific to the filter.
Custom operators defined on a filter take precedence over operators defined globally on the QueryEngine. This is useful if you wish to have a custom operator only for a specific filter, or if you wish to override the default behavior of a built-in operator for a specific filter. If the operator already exists, the existing operator is returned.
// Override global operators with specific operator handlers for this filter filter.AddOperator("=").AddHandler((Vector2 ev, Vector2 fv) => ev == fv); filter.AddOperator("!=").AddHandler((Vector2 ev, Vector2 fv) => ev != fv);
See IQueryEngineFilter for a complete example.