레퍼런스 › 함수 레퍼런스 › Core

Core.point_conditions.GetConditionPointResourceV2

공개

호출 방법

addon:GetConditionPointResourceV2(unit, cache)

addon을 통해 바로 쓸 수 있으며, 의존성이 필요 없습니다.

하는 일

원래의 실시간 직업 대응과 식별 캐시, 그리고 명시적인 TBC 플레이어 ComboPoints 대체 전달 정책으로 점수 자원을 확인합니다. 모듈을 불러올 때 캡처한 읽을 수 있는 원시 Enum.PowerType 테이블과 ComboPoints 값에 맞는 플레이어 대체는 target-combo를 선택하며, 명시적인 직업 맵 항목, 다른 대상, 다른 계열은 power를 유지합니다. 대체가 교체되었거나, 상속되었거나, 출처를 증명할 수 없으면 power를 유지합니다. 이 버전별 정책은 기본 UnitPower가 고장 났다거나 동등하다고 주장하지 않습니다. 유닛이 없는 것으로 알려지면 false를, 필수 관찰을 사용할 수 없으면 nil과 이유를 반환합니다. 여기서는 현재나 최대 수량을 조회하지 않습니다.

인수

이름유형하는 일
selfRMAddonRotation Master 애드온 인스턴스 (콜론 호출에서는 암묵적).
unitstring선택한 정확한 유닛 토큰. 리터럴 player 토큰만 TBC 연계 점수 전달 방식을 선택할 수 있습니다.
cachetable | nil평가 패스 캐시. 식별 정보를 직접 관찰하려면 nil. 성공한 플레이어 직업 관찰은 기존 장기 식별 캐시를 사용할 수 있으며, 자원 대응은 실시간으로 유지됩니다.

반환값

1number | boolean | nil명시적인 음수가 아닌 정수 선택자, 유닛이 없는 것으로 알려지면 false, 필수 데이터를 사용할 수 없으면 nil.
2string | nilnil인 선택자에 대한 정책, 조회 검증 또는 식별/선택자 사용 불가 이유.
3string | nil선택한 자원에서만 사용: 명시적인 TBC 플레이어 대체에는 target-combo, 기존 선택 유닛 전달 방식에는 power.

버전

기본 제공 도우미는 모든 버전에 등록됩니다. 다른 점은 읽는 게임 API이며, API가 없으면 도우미는 대체 동작을 하거나 이유와 함께 nil을 반환합니다.

  • 해당 버전에서 사용할 수 없음 (이유는 툴팁에 표시)
  • Blizzard의 지원 중단 대체 함수가 켜져 있을 때만
게임 APIClassic EraTBC AnniversaryClassic progressionForeverRetail
EnumClassic EraTBC AnniversaryClassic progressionForeverRetail
canaccessvalueClassic EraTBC AnniversaryClassic progressionForeverRetail

비공개 값 (Retail과 Forever)

Retail과 Forever에서는 게임이 애드온에 비공개 값을 넘깁니다. 이 도우미는 읽는 값을 확인하고(addon.Platform:CanReadValue), 비교할 수 없는 비공개 값 대신 restricted-value 같은 이유와 함께 nil을 반환합니다. nil은 거짓이 아니라 사용할 수 없음으로 취급하세요.

애드온에서 호출하는 방식

  • 점수 (evaluate)
    local point,reason,transport=addon:GetConditionPointResourceV2(value.unit,cache)

의존성

소스

Core/point_conditions.lua, 210번째 줄. 게임에서는 읽기 전용이며, 복제하면 편집 가능한 사본이 생깁니다.

Core.point_conditions.GetConditionPointResourceV2(self, unit, cache)
    local platform=self.Platform
    local info=platform:GetClientInfo()
    local policy=info.combatDataPolicy
    if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
    if not platform:CanReadValue(unit) then return nil,'restricted-value' end
    if type(unit)~='string' or unit=='' then return nil,'invalid-unit' end
    local record,reason=addon.Functions.cache.getCached(cache,pointIdentity,self,unit,playerClassCacheKey)
    if not record then return nil,reason end
    if not record.exists then return false end
    local family=info.family
    if policy=='probe' and (family=='era' or family=='progression') then return editionPointResource(platform,info,unit,record.class,cache) end
    local points=self.points
    if not platform:CanReadValue(points) then return nil,'restricted-value' end
    if type(points)~='table' then return nil,'invalid-point-resource-map' end
    local fallbackEnum,fallbackTypes
    local ok,selected=pcall(function() return points[record.class] end)
    if not ok then return nil,'api-error' end
    if not platform:CanReadValue(selected) then return nil,'restricted-value' end
    if selected==nil or selected==false then
        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 typesOK,types=pcall(function() return enum.PowerType end)
        if not typesOK then return nil,'api-error' end
        if not platform:CanReadValue(types) then return nil,'restricted-value' end
        if type(types)~='table' then return nil,'point-resource-unavailable' end
        local fallbackOK,fallback=pcall(function() return types.ComboPoints end)
        if not fallbackOK then return nil,'api-error' end
        selected=fallback
        if not platform:CanReadValue(selected) then return nil,'restricted-value' end
        fallbackEnum,fallbackTypes=enum,types
    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
    if policy=='restricted' and not platform:IsNeverSecretPointPower(selected) then return nil,'unsupported-policy' end
    local transport='power'
    if unit=='player' and fallbackTypes then
        local rawTypes,rawCombo=rawget(fallbackEnum,'PowerType'),rawget(fallbackTypes,'ComboPoints')
        if platform:CanReadValue(pointComboTypes) and (not canaccessvalue or canaccessvalue(pointComboTypes))
            and platform:CanReadValue(rawTypes) and (not canaccessvalue or canaccessvalue(rawTypes))
            and rawequal(fallbackTypes,pointComboTypes) and rawequal(rawTypes,fallbackTypes)
            and platform:CanReadValue(rawCombo) and (not canaccessvalue or canaccessvalue(rawCombo)) and rawCombo==selected
            and platform:CanReadValue(pointComboValue) and (not canaccessvalue or canaccessvalue(pointComboValue))
            and pointComboValue==selected then
            local family
            if platform:CanReadValue(info) and type(info)=='table' then family=rawget(info,'family') end
            if platform:CanReadValue(family) and (not canaccessvalue or canaccessvalue(family)) and family=='tbc' then transport='target-combo' end
        end
    end
    return selected,nil,transport

함수 레퍼런스(으)로 돌아가기