Как вызывать
Conditions.spatial.rangeMember(cache, unit, distance)
Запишите зависимость Conditions.spatial.rangeMember и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
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.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
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. |
Возвращает
| 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. |
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
Conditions.spatial.nameplateDistanceCountlocal member,why=rangeMember(cache,unit,value.distance)
Зависимости
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
Исходный код
Conditions/spatial.lua, строка 656. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
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"