호출 방법
addon.Platform:GetPlayerFlagObservation(kind)
addon을 통해 바로 쓸 수 있으며, 의존성이 필요 없습니다.
하는 일
인수 없는 독립 플레이어 플래그 하나를 관찰합니다. stealthed는 IsStealthed, control은 HasFullControl, outdoors는 IsOutdoors를 사용합니다. 읽을 수 있는 true와 false는 의미를 유지합니다. 필수 데이터가 없거나, 실패하거나, nil이거나, 제한되거나, 잘못되면 nil과 이유를 반환합니다. 존재, 인스턴스, 기술 사용 가능 여부 추론은 추가하지 않습니다.
인수
| 이름 | 유형 | 하는 일 |
|---|---|---|
self | RMPlatform | Rotation Master 플랫폼 어댑터 (콜론 호출에서는 암묵적). |
kind | string | stealthed, control, outdoors 중 하나. 다른 조건식은 호출하지 않습니다. |
반환값
| 1 | boolean | nil | 읽을 수 있는 선택 플래그. 필수 데이터를 사용할 수 없으면 nil. |
|---|---|---|
| 2 | string | nil | nil인 플레이어 플래그에 대한 정책, 조회 검증 또는 사용 불가 이유. |
버전
기본 제공 도우미는 모든 버전에 등록됩니다. 다른 점은 읽는 게임 API이며, API가 없으면 도우미는 대체 동작을 하거나 이유와 함께 nil을 반환합니다.
- 해당 버전에서 사용할 수 없음 (이유는 툴팁에 표시)
- Blizzard의 지원 중단 대체 함수가 켜져 있을 때만
| 게임 API | |||||
|---|---|---|---|---|---|
HasFullControl | |||||
IsOutdoors | |||||
IsStealthed |
비공개 값 (Retail과 Forever)
Retail과 Forever에서는 게임이 애드온에 비공개 값을 넘깁니다. 이 도우미는 읽는 값을 확인하고(addon.Platform:CanReadValue), 비교할 수 없는 비공개 값 대신 restricted-value 같은 이유와 함께 nil을 반환합니다. nil은 거짓이 아니라 사용할 수 없음으로 취급하세요.
예시
local stealthed = addon.Platform:GetPlayerFlagObservation("stealthed")
local outdoors = addon.Platform:GetPlayerFlagObservation("outdoors")
if stealthed == nil or outdoors == nil then return nil end
return outdoors and not stealthed소스
Platform/player_flags.lua, 18번째 줄. 게임에서는 읽기 전용이며, 복제하면 편집 가능한 사본이 생깁니다.
Platform.player_flags.GetPlayerFlagObservation(self, kind)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
if not self:CanReadValue(kind) then return nil,'restricted-value' end
if kind~='stealthed' and kind~='control' and kind~='outdoors' then return nil,'invalid-player-flag-query' end
local api
if kind=='stealthed' then api=IsStealthed
elseif kind=='control' then api=HasFullControl
else api=IsOutdoors end
if type(api)~='function' then return nil,'missing-api' end
local ok,result=pcall(api)
if not ok then return nil,'api-error' end
if not self:CanReadValue(result) then return nil,'restricted-value' end
if result==nil then return nil,'player-flag-unavailable' end
if type(result)~='boolean' then return nil,'invalid-api-result' end
return result




