• Pure

    Returns a new filterfunc, when called by the game returns the result of evaluating func(). func will receive no arguments and must return a boolean: true/false.

    Parameters

    Returns HandleHolder<"filterfunc">

    Note

    Lua, 1.32.10: filterfunc extends from boolexpr->agent and must be explicitly destroyed with DestroyBoolExpr/DestroyFilter to prevent leaks. However, most functions from blizzard.j destroy passed boolexpr automatically.

    Note

    Lua: Always returns a new handle unless the passed parameter is nil, in this case it MAY return the same handle depending on unknown conditions (consecutive calls are likely to reuse previous handle).

    Jass: Returns same handle when creating multiple filters for the same function: Filter(function foo) == Filter(function foo) ("foo" can be non-constant and constant).

    For this reason, do not destroy filterfuncs created with Filter in Jass, in the best case it does nothing but in the worst case it would affect some internals.

    This behavior is similar to Condition.

    Note

    See: And, Or, Not, Condition, DestroyFilter; GetFilterUnit, GetFilterItem, GetFilterPlayer, GetFilterDestructable.

Generated using TypeDoc