Call as
addon.Platform:GetUnitPointPowerObservation(unit, powerType, kind)
Available directly through addon; no dependency is needed.
What it does
Read one explicitly selected point-resource quantity with an exact two-argument UnitPower or UnitPowerMax query. The selector is required; no primary-resource inference or actor remapping occurs. Preserve finite signed, fractional and zero quantities without clamping. Missing, failed, restricted or nonfinite data remains unavailable. Current and maximum are separate observations so callers can share current snapshots while requesting maximum lazily.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Exact unit token whose selected resource quantity is requested. |
powerType | number | Explicit readable finite nonnegative integer power selector, including zero. |
kind | string | Exactly current for UnitPower or maximum for UnitPowerMax; no other native query is added. |
Returns
| 1 | number | nil | Finite native resource quantity, retaining its sign and fractional part; nil when unavailable. |
|---|---|---|
| 2 | string | nil | Policy, query-validation or availability reason for a nil quantity. |
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
| Game API | |||||
|---|---|---|---|---|---|
UnitPower | |||||
UnitPowerMax | |||||
canaccessvalue |
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
Example
local holyPower = addon.Platform:GetUnitPointPowerObservation("player", Enum.PowerType.HolyPower, "current")
if holyPower == nil then return nil end
return holyPower >= 3Dependencies
pointFragmentType(builtin:Platform/points.lua:pointFragmentType)
Source
Platform/points.lua, line 189. Read only in game; Duplicate makes an editable copy.
Platform.points.GetUnitPointPowerObservation(self, unit, powerType, kind)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and (policy~='restricted' or not self:IsNeverSecretPointPower(powerType)) then return nil,'unsupported-policy' end
if not self:CanReadValue(unit) or not self:CanReadValue(powerType) or not self:CanReadValue(kind) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' then return nil,'invalid-unit' end
if type(powerType)~='number' or powerType~=powerType or powerType<0 or powerType==math.huge or powerType%1~=0 then return nil,'invalid-point-power-query' end
if kind~='current' and kind~='maximum' then return nil,'invalid-point-power-query' end
if powerType==pointFragmentType then return self:GetUnitPointFragmentObservation(unit,powerType,kind) end
local api
if kind=='current' then api=UnitPower else api=UnitPowerMax end
if type(api)~='function' then return nil,'missing-api' end
local ok,result=pcall(api,unit,powerType)
if not ok then return nil,'api-error' end
if not self:CanReadValue(result) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(result) then return nil,'restricted-value' end
if result==nil then return nil,'point-power-unavailable' end
if type(result)~='number' or result~=result or result==math.huge or result==-math.huge then return nil,'invalid-api-result' end
return result




