Chame como
Conditions.spatial.rangeMember(cache, unit, distance)
Registre a dependência Conditions.spatial.rangeMember 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
Decides whether unit is within distance yards from the platform's cached range-check bounds: true when the maximum bound is at or inside distance, false when the minimum bound is beyond it (or equals a nonzero distance), otherwise unavailable.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
unit | string | Unit token to check. |
distance | number | Distance in yards. |
Retornos
| 1 | boolean | nil | Whether the unit is within distance, or nil when the bounds cannot decide. |
|---|---|---|
| 2 | string | nil | The bounds reader's reason, or range-uncertain. |
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
Conditions.spatial.nameplateDistanceCountlocal member,why=rangeMember(cache,unit,value.distance)
Dependências
Functions.cache.getCached→Functions.cache.getCachedFunctions.presentation.compareString→Functions.presentation.compareStringFunctions.presentation.nullable→Functions.presentation.nullableFunctions.presentation.playerize→Functions.presentation.playerizeFunctions.values.compare→Functions.values.compareFunctions.values.isin→Functions.values.isin
Código-fonte
Conditions/spatial.lua, linha 656. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.spatial.rangeMember(cache, unit, distance)
local bounds,why=Functions.cache.getCached(cache,addon.Platform.GetRangeCheckBounds,addon.Platform,unit)
if not bounds then return nil,why end
if bounds.maximum and bounds.maximum<=distance then return true end
if bounds.minimum and (bounds.minimum>distance or bounds.minimum>0 and bounds.minimum==distance) then return false end
return nil,"range-uncertain"