本文整理汇总了C++中FGameplayTagContainer::Num方法的典型用法代码示例。如果您正苦于以下问题:C++ FGameplayTagContainer::Num方法的具体用法?C++ FGameplayTagContainer::Num怎么用?C++ FGameplayTagContainer::Num使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FGameplayTagContainer
的用法示例。
在下文中一共展示了FGameplayTagContainer::Num方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EmitTagTokens
void UEditableGameplayTagQueryExpression::EmitTagTokens(FGameplayTagContainer const& TagsToEmit, TArray<uint8>& TokenStream, TArray<FGameplayTag>& TagDictionary, FString* DebugString) const
{
uint8 const NumTags = (uint8)TagsToEmit.Num();
TokenStream.Add(NumTags);
bool bFirstTag = true;
for (auto T : TagsToEmit)
{
int32 TagIdx = TagDictionary.AddUnique(T);
check(TagIdx <= 255);
TokenStream.Add((uint8)TagIdx);
if (DebugString)
{
if (bFirstTag == false)
{
DebugString->Append(TEXT(","));
}
DebugString->Append(TEXT(" "));
DebugString->Append(T.ToString());
}
bFirstTag = false;
}
}
示例2: VerifyAssetTagValidity
void SGameplayTagWidget::VerifyAssetTagValidity()
{
FGameplayTagContainer LibraryTags;
// Create a set that is the library of all valid tags
TArray< TSharedPtr<FGameplayTagNode> > NodeStack;
UGameplayTagsManager& TagsManager = IGameplayTagsModule::Get().GetGameplayTagsManager();
TagsManager.GetFilteredGameplayRootTags(TEXT(""), NodeStack);
while (NodeStack.Num() > 0)
{
TSharedPtr<FGameplayTagNode> CurNode = NodeStack.Pop();
if (CurNode.IsValid())
{
LibraryTags.AddTag(TagsManager.RequestGameplayTag(CurNode->GetCompleteTag()));
NodeStack.Append(CurNode->GetChildTagNodes());
}
}
// Find and remove any tags on the asset that are no longer in the library
for (int32 ContainerIdx = 0; ContainerIdx < TagContainers.Num(); ++ContainerIdx)
{
UObject* OwnerObj = TagContainers[ContainerIdx].TagContainerOwner.Get();
FGameplayTagContainer* Container = TagContainers[ContainerIdx].TagContainer;
if (Container)
{
FGameplayTagContainer EditableContainer = *Container;
FGameplayTagContainer InvalidTags;
for (auto It = Container->CreateConstIterator(); It; ++It)
{
if (!LibraryTags.HasTag(*It, EGameplayTagMatchType::Explicit, EGameplayTagMatchType::Explicit))
{
InvalidTags.AddTag(*It);
}
}
if (InvalidTags.Num() > 0)
{
FString InvalidTagNames;
for (auto InvalidIter = InvalidTags.CreateConstIterator(); InvalidIter; ++InvalidIter)
{
EditableContainer.RemoveTag(*InvalidIter);
InvalidTagNames += InvalidIter->ToString() + TEXT("\n");
}
SetContainer(Container, &EditableContainer, OwnerObj);
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("Objects"), FText::FromString( InvalidTagNames ));
FText DialogText = FText::Format( LOCTEXT("GameplayTagWidget_InvalidTags", "Invalid Tags that have been removed: \n\n{Objects}"), Arguments );
OpenMsgDlgInt( EAppMsgType::Ok, DialogText, LOCTEXT("GameplayTagWidget_Warning", "Warning") );
}
}
}
}
示例3: AppendTags
void FGameplayTagContainer::AppendTags(FGameplayTagContainer const& Other)
{
SCOPE_CYCLE_COUNTER(STAT_FGameplayTagContainer_AppendTags);
GameplayTags.Reserve(Other.Num());
//add all the tags
for(TArray<FGameplayTag>::TConstIterator It(Other.GameplayTags); It; ++It)
{
AddTag(*It);
}
}