Riferimento › Riferimento delle funzioni › Conditions

Conditions.spatial.rangeMember

dipendenza

Chiamala come

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

Registra la dipendenza Conditions.spatial.rangeMember, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.

Cosa fa

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.

Argomenti

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

Valori restituiti

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

Edizioni

Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.

Non legge direttamente alcuna API di gioco.

Come la chiama l'addon

Dipendenze

Sorgente

Conditions/spatial.lua, riga 656. Nel gioco è in sola lettura; Duplica crea una copia modificabile.

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"

Torna a Riferimento delle funzioni