호출 방법
addon.Platform:GetRuneCooldownObservation(index)
addon을 통해 바로 쓸 수 있으며, 의존성이 필요 없습니다.
하는 일
정확한 기본 칸에 대해 보호된 GetRuneCooldown 튜플 하나를 읽습니다. ready, start, duration을 각각 정규화하며, ready는 읽을 수 있는 불리언이, 각 시간 값은 읽을 수 있는 유한한 숫자가 필요하고 부호 있는 값, 소수, 0을 보존합니다. 사용할 수 없는 필드마다 자체 이유가 있습니다. 성공한 빈 튜플은 부분 레코드를, 기능 없음, 정책, 기본 호출 실패는 nil을 냅니다. 시간에서 ready를, ready에서 시간을 추론하지 않습니다. 룬 개수와 재사용 대기시간 조건식이 관찰 하나를 공유하도록 호출자 쪽에서 이 완전한 레코드를 캐시하세요.
인수
| 이름 | 유형 | 하는 일 |
|---|---|---|
self | RMPlatform | Rotation Master 플랫폼 어댑터 (콜론 호출에서는 암묵적). |
index | number | 1부터 6까지의 정확한 정수 기본 룬 칸. |
반환값
| 1 | table | nil | ready 또는 readyReason, start 또는 startReason, duration 또는 durationReason을 담은 부분 레코드. 조회 자체를 사용할 수 없을 때만 nil. |
|---|---|---|
| 2 | string | nil | nil인 레코드에 대한 정책, 칸 검증, 기능 또는 기본 호출 사용 불가 이유. |
버전
기본 제공 도우미는 모든 버전에 등록됩니다. 다른 점은 읽는 게임 API이며, API가 없으면 도우미는 대체 동작을 하거나 이유와 함께 nil을 반환합니다.
- 해당 버전에서 사용할 수 없음 (이유는 툴팁에 표시)
- Blizzard의 지원 중단 대체 함수가 켜져 있을 때만
| 게임 API | |||||
|---|---|---|---|---|---|
GetRuneCooldown |
비공개 값 (Retail과 Forever)
Retail과 Forever에서는 게임이 애드온에 비공개 값을 넘깁니다. 이 도우미는 읽는 값을 확인하고(addon.Platform:CanReadValue), 비교할 수 없는 비공개 값 대신 restricted-value 같은 이유와 함께 nil을 반환합니다. nil은 거짓이 아니라 사용할 수 없음으로 취급하세요.
예시
local rune = addon.Platform:GetRuneCooldownObservation(1)
if not rune or rune.ready == nil then return nil end
return rune.ready의존성
numberField→Platform.runes.numberFieldvalidIndex→Platform.runes.validIndex
소스
Platform/runes.lua, 72번째 줄. 게임에서는 읽기 전용이며, 복제하면 편집 가능한 사본이 생깁니다.
Platform.runes.GetRuneCooldownObservation(self, index)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
local valid,reason=validIndex(self,index)
if not valid then return nil,reason end
local api=GetRuneCooldown
if type(api)~='function' then return nil,'missing-api' end
local ok,tuple=pcall(function() return {api(index)} end)
if not ok then return nil,'api-error' end
local record={}
record.start,record.startReason=numberField(self,tuple[1],'rune-start-unavailable')
record.duration,record.durationReason=numberField(self,tuple[2],'rune-duration-unavailable')
local ready=tuple[3]
if not self:CanReadValue(ready) then record.readyReason='restricted-value'
elseif ready==nil then record.readyReason='rune-ready-unavailable'
elseif type(ready)~='boolean' then record.readyReason='invalid-api-result'
else record.ready=ready end
return record




