Referencia › Referencia de funciones › Conditions

Conditions.spatial.rangeMember

dependencia

Llamar como

Conditions.spatial.rangeMember(cache, unit, distance)

Registra la dependencia Conditions.spatial.rangeMember y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.

Qué hace

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

NombreTipoQué hace
cachetable | nilEvaluation-pass cache passed to getCached, or nil to read directly.
unitstringUnit token to check.
distancenumberDistance in yards.

Retornos

1boolean | nilWhether the unit is within distance, or nil when the bounds cannot decide.
2string | nilThe bounds reader's reason, or range-uncertain.

Ediciones

Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.

No lee directamente ninguna API del juego.

Cómo la llama el addon

Dependencias

Código fuente

Conditions/spatial.lua, línea 656. Solo lectura en el juego; Duplicar crea una copia editable.

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"

Volver a Referencia de funciones