本文整理汇总了C++中FGameplayTagContainer::MatchesAll方法的典型用法代码示例。如果您正苦于以下问题:C++ FGameplayTagContainer::MatchesAll方法的具体用法?C++ FGameplayTagContainer::MatchesAll怎么用?C++ FGameplayTagContainer::MatchesAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FGameplayTagContainer
的用法示例。
在下文中一共展示了FGameplayTagContainer::MatchesAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequirementsMet
bool FGameplayTagRequirements::RequirementsMet(const FGameplayTagContainer& Container) const
{
bool HasRequired = Container.MatchesAll(RequireTags, true);
bool HasIgnored = Container.MatchesAny(IgnoreTags, false);
return HasRequired && !HasIgnored;
}
示例2: GatherMods
float FGAEffectModifiersContainer::GatherMods(const FGameplayTagContainer& TagsIn, const TMap<FGAGameEffectHandle, TArray<FGAGameEffectModifier>>& Data)
{
//possible optimization when needed - create separate thread.
float ModifierVal = 0;
float Add = 0;
float Multiply = 1;
float Subtract = 0;
float Divide = 1;
float PercentageAdd = 0;
float PercentageSubtract = 0;
for (auto It = Data.CreateConstIterator(); It; ++It)
{
for (const FGAGameEffectModifier& Test : It->Value)
{
if (TagsIn.MatchesAll(Test.RequiredTags, false))
{
switch (Test.ModType)
{
case EGAAttributeMod::Add:
Add += Test.Value;
break;
case EGAAttributeMod::Multiply:
Multiply += Test.Value;
break;
case EGAAttributeMod::Subtract:
Subtract += Test.Value;
break;
case EGAAttributeMod::Divide:
Divide += Test.Value;
break;
case EGAAttributeMod::PercentageAdd:
PercentageAdd += Test.Value;
break;
case EGAAttributeMod::PercentageSubtract:
PercentageSubtract += Test.Value;
break;
default:
break;
}
}
}
}
ModifierVal = ((Add - Subtract) * Multiply) / Divide;
ModifierVal = ModifierVal + (ModifierVal * PercentageAdd);
ModifierVal = ModifierVal - (ModifierVal * PercentageSubtract);
SCOPE_CYCLE_COUNTER(STAT_GatherModifiers);
return ModifierVal;
}