Chame como
Conditions.group_state.validCompare(value)
Registre a dependência Conditions.group_state.validCompare e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
Checks that a Group Count value carries a known operator and a finite, non-negative number, which is at most 100 when the count is a percent of the group.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
value | table | The condition value, read for its operator, value and percent fields. |
Retornos
| 1 | boolean | True when the comparison is valid. |
|---|
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
Não lê nenhuma API do jogo diretamente.
Como o addon a chama
- Contagem do grupo (valid)
and validCompare(value)
Dependências
Functions.cache.getCached→Functions.cache.getCachedFunctions.presentation.compareString→Functions.presentation.compareStringFunctions.presentation.nullable→Functions.presentation.nullableFunctions.values.compare→Functions.values.compareFunctions.values.isin→Functions.values.isin
Código-fonte
Conditions/group_state.lua, linha 59. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.group_state.validCompare(value)
if value.operator == nil or not Functions.values.isin(addon.operators, value.operator) then return false end
if type(value.value) ~= "number" or value.value ~= value.value or value.value < 0 or value.value >= math.huge then return false end
return value.percent ~= true or value.value <= 100