Reference › Function reference › Conditions

Conditions.encounter_state.validCompare

dependency

Call as

Conditions.encounter_state.validCompare(value)

Record the dependency Conditions.encounter_state.validCompare, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

Checks that a condition value carries a known comparison operator and a finite, non-negative number to compare against.

Arguments

NameTypeWhat it does
valuetableThe condition value, read for its operator and value fields.

Returns

1booleanTrue when both are valid.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

Dependencies

Source

Conditions/encounter_state.lua, line 50. Read only in game; Duplicate makes an editable copy.

Conditions.encounter_state.validCompare(value)
    return value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) and validNumber(value.value)

Back to Function reference