• Pure

    Returns a new conditionfunc, 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<"conditionfunc">

    Note

    1.32.10, Lua: conditionfunc extends from boolexpr->agent and must be explicitly destroyed with DestroyBoolExpr/DestroyCondition 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: Condition(function foo) == Condition(function foo) ("foo" can be non-constant and constant).

    For this reason, do not destroy filterfuncs created with Condition 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, Filter, DestroyCondition

Generated using TypeDoc