Aufruf als
Conditions.spatial.nameplateDistanceCount(value, cache, plates)
Erfassen Sie die Abhängigkeit Conditions.spatial.nameplateDistanceCount und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.
Was sie bewirkt
Counts units for DISTANCE_COUNT from a nameplate unit snapshot: units that exist, whose hostility matches value.enemy, and that are definitely within value.distance yards. Compares the count with value.operator and value.value; any unreadable unit or uncertain range makes the whole result unavailable.
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
value | table | Condition settings: enemy, distance, operator and value. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
plates | table | Snapshot whose keys are nameplate unit tokens. |
Rückgabewerte
| 1 | boolean | nil | Result of the count comparison, or nil when the count cannot be established. |
|---|---|---|
| 2 | string | nil | Reason for nil, such as unit-snapshot-unavailable, invalid-unit-snapshot, restricted-value or range-uncertain. |
Editionen
Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.
- Auf dieser Edition nicht verfügbar (den Grund nennt der Tooltip)
- Nur, solange Blizzards Ersatz für veraltete Funktionen aktiv ist
| Spiel-API | |||||
|---|---|---|---|---|---|
UnitExists | |||||
UnitIsEnemy |
Geheime Werte (Retail und Forever)
Auf Retail und Forever übergibt das Spiel Addons geheime Werte. Diese Hilfsfunktion prüft, was sie liest (addon.Platform:CanReadValue), und gibt statt eines geheimen Werts, den sie nicht vergleichen kann, nil mit einem Grund wie restricted-value zurück. Behandeln Sie nil als nicht verfügbar, nicht als false.
Wie das Addon sie aufruft
- Anzahl in Entfernung (evaluate)
if plates~=nil then return nameplateDistanceCount(value,cache,plates) end
Abhängigkeiten
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.isinbooleanRead→Conditions.spatial.booleanReadcombatFilter→Conditions.spatial.combatFilterrangeMember→Conditions.spatial.rangeMember
Quelle
Conditions/spatial.lua, Zeile 690. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Conditions.spatial.nameplateDistanceCount(value, cache, plates)
if type(plates)~="table" then return nil,"unit-snapshot-unavailable" end
local count = 0
for unit in pairs(plates) do
if not addon.Platform:CanReadValue(unit) then return nil,"restricted-value" end
if type(unit)~="string" or unit=="" then return nil,"invalid-unit-snapshot" end
local present,issue=booleanRead(cache,UnitExists,unit)
if present==nil then return nil,issue end
if present then
local enemy,problem=booleanRead(cache,UnitIsEnemy,"player",unit)
if enemy==nil then return nil,problem end
if enemy==value.enemy then
local fighting,combatWhy=combatFilter(value,cache,unit)
if fighting==nil then return nil,combatWhy end
if fighting then
local member,why=rangeMember(cache,unit,value.distance)
if member==nil then return nil,why end
if member then count=count+1 end
end
end
end
end
return Functions.values.compare(value.operator, count, value.value)




