Référence › Référence des fonctions › Conditions

Conditions.spatial.rangeMember

dépendance

Appel

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

Enregistrez la dépendance Conditions.spatial.rangeMember, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.

Ce qu'elle fait

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.

Arguments

NomTypeCe qu'elle fait
cachetable | nilEvaluation-pass cache passed to getCached, or nil to read directly.
unitstringUnit token to check.
distancenumberDistance in yards.

Retours

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

Éditions

Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.

Elle ne lit directement aucune API du jeu.

Comment l'addon l'appelle

Dépendances

Source

Conditions/spatial.lua, ligne 656. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.

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"

Retour à Référence des fonctions