내일배움캠프-언리얼

TIL - 78

이시보 2026. 5. 21. 21:39

DT와 값 비교

GameplayAbility의 DT에서 ElementPattern 10종류를 현재 ElementPattern과 비교하여 동일 패턴 찾기

TMap<FGameplayTag, int32> ElementPattern으로 저장되어 있음

bool UGA_Burst::DoesCombinationMatch(
    const TMap<FGameplayTag, int32>& Pattern,
    const TMap<FGameplayTag, int32>& Actual)
{
    // 0 카운트는 TMap에 들어가지 않으므로 크기가 같아야 동일 조합
    if (Pattern.Num() != Actual.Num()) return false;

    for (const TPair<FGameplayTag, int32>& Pair : Pattern)
    {
        const int32* ActualCount = Actual.Find(Pair.Key);
        if (!ActualCount || *ActualCount != Pair.Value)
        {
            return false;
        }
    }
    return true;
}

 

'내일배움캠프-언리얼' 카테고리의 다른 글

TIL - 80  (0) 2026.05.27
TIL - 79  (0) 2026.05.26
TIL - 77  (0) 2026.05.20
TIL - 76  (0) 2026.05.19
TIL - 75  (0) 2026.05.13