Skip to content

Add version of GetUnits to take a set of filters #98

@ImpulseCloud

Description

@ImpulseCloud

Is your feature request related to a problem? Please describe.
Currently, only 1 type of Filter can be passed to GetUnits to return a filtered list of units. We then have to do additional manually filtering after the initial call.

Describe the solution you'd like
It would be great to use multiple filters in one call.

alkurbatov: "i.e. assuming that we have IsNonSaturatedTownHall, IsTownHall and IsFinished it would be convenient to use e.g. 'AllOf' predicate which uses inside all of these." -- "I suggest to add it ... in the form of a separate call like getUnits, but getUnitsAllOf with array of filters passed by reference. In this case the implementation will be much simpler."

Describe alternatives you've considered
Instead of an array of filters, allow sequential chaining composition. [e.g. .GetUnits( IsNonSaturated( IsFinished( IsTownHall())) ) ] A filter could take a filter input and output a compound filter.

References for different chaining syntaxes:
https://www.fluentcpp.com/2019/08/06/chaining-output-iterators-into-a-pipeline/
http://cpptruths.blogspot.com/2014/03/fun-with-lambdas-c14-style-part-1.html
https://stackoverflow.com/questions/8367879/c-lambda-expression-for-method-chains
https://chriskohlhepp.wordpress.com/advanced-c-lisp/lambda-over-lambda-in-cplusplus14/

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions