Aufruf als
Core.point_conditions.editionPointResource(platform, info, unit, class, cache)
Erfassen Sie die Abhängigkeit Core.point_conditions.editionPointResource 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
Selects the point resource for era and progression clients from the addon's per-edition map (combo points, Holy Power, Soul Shards, Chi, Shadow Orbs and similar). When the resource depends on specialization, only the player can be resolved.
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
platform | RMPlatform | Platform used for readability checks and the player's specialization. |
info | table | Client info with family and, on progression clients, expansion. |
unit | string | Unit token the resource is for. |
class | string | The unit's class file token. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
Rückgabewerte
| 1 | number | nil | Enum.PowerType value of the selected resource, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Nil on success; otherwise the reason, such as unsupported-point-expansion, point-specialization-unavailable, point-resource-unavailable or invalid-point-resource. |
| 3 | string | nil | "power" on success, marking the selector as a power type; absent on failure. |
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 | |||||
|---|---|---|---|---|---|
Enum |
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
Core.point_conditions.GetConditionPointResourceV2if policy=='probe' and (family=='era' or family=='progression') then return editionPointResource(platform,info,unit,record.class,cache) end
Abhängigkeiten
editionPointPowers(builtin:Core/point_conditions.lua:editionPointPowers)
Quelle
Core/point_conditions.lua, Zeile 163. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Core.point_conditions.editionPointResource(platform, info, unit, class, cache)
local family=info.family
local map=editionPointPowers[family]
if family=='progression' then
local expansion=info.expansion
if not platform:CanReadValue(expansion) then return nil,'restricted-value' end
if type(expansion)~='number' then return nil,'unsupported-point-expansion' end
map=map[expansion]
if map==nil then return nil,'unsupported-point-expansion' end
end
local name=map[class]
if type(name)=='table' then
-- Only the player's own specialization is readable.
if unit~='player' then return nil,'point-specialization-unavailable' end
local spec,why=addon.Functions.cache.getCached(cache,platform.GetPlayerSpecializationIndex,platform)
if spec==nil then return nil,why end
name=name[spec]
end
if name==nil then return nil,'point-resource-unavailable' end
local enum=Enum
if not platform:CanReadValue(enum) then return nil,'restricted-value' end
if type(enum)~='table' then return nil,'point-resource-unavailable' end
local types=rawget(enum,'PowerType')
if not platform:CanReadValue(types) then return nil,'restricted-value' end
if type(types)~='table' then return nil,'point-resource-unavailable' end
local selected=rawget(types,name)
if not platform:CanReadValue(selected) then return nil,'restricted-value' end
if selected==nil then return nil,'point-resource-unavailable' end
if type(selected)~='number' or selected~=selected or selected<0 or selected==math.huge or selected%1~=0 then return nil,'invalid-point-resource' end
return selected,nil,'power'




