Aufruf als
Conditions.spatial.protectedRead(cache, method, ...)
Erfassen Sie die Abhängigkeit Conditions.spatial.protectedRead 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
Mitgelieferte Hilfsfunktion aus Conditions/spatial.lua.
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
method | function | Function to call; any other value returns false and missing-api. |
... | any | Arguments forwarded to method. |
Rückgabewerte
| 1 | boolean | True when the call succeeded, as pcall reports it. |
|---|---|---|
| 2 | any | On success, every result of method; on failure, the error message or missing-api. |
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.
Sie liest keine Spiel-API direkt.
Wie das Addon sie aufruft
- Anzahl in Entfernung (evaluate)
local ok,current=protectedRead(cache,UnitGUID,entity.unit) Conditions.spatial.booleanReadlocal ok,result=protectedRead(cache,method,...)
Quelle
Functions/cache.lua, Zeile 24. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Conditions.spatial.protectedRead(cache, method, ...)
if type(method)~="function" then return false,"missing-api" end
return pcall(addon.getCached,cache,method,...)