Navigation
Unreal Engine C++ API Reference > Runtime > GameplayTags
References
Module | GameplayTags |
Header | /Engine/Source/Runtime/GameplayTags/Classes/GameplayTagContainer.h |
Include | #include "GameplayTagContainer.h" |
Syntax
USTRUCT (BlueprintType ,
Meta=(HasNativeMake="/Script/GameplayTags.BlueprintGameplayTagLibrary.MakeGameplayTagContainerFromArray", HasNativeBreak="/Script/GameplayTags.BlueprintGameplayTagLibrary.BreakGameplayTagContainer"))
struct FGameplayTagContainer
Remarks
A Tag Container holds a collection of FGameplayTags, tags are included explicitly by adding them, and implicitly from adding child tags
Variables
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() ![]() ![]() |
TArray< FGameplayTag > | GameplayTags | Array of gameplay tags |
![]() ![]() ![]() |
TArray< FGameplayTag > | ParentTags | Array of expanded parent tags, in addition to GameplayTags. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Constructors | ||
![]() |
FGameplayTagContainer
(
FGameplayTagContainer const& Other |
||
![]() |
FGameplayTagContainer
(
const FGameplayTag& Tag |
Explicit to prevent people from accidentally using the wrong type of operation | |
![]() |
FGameplayTagContainer
(
FGameplayTagContainer&& Other |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
bool | AddLeafTag
(
const FGameplayTag& TagToAdd |
Adds a tag to the container and removes any direct parents, wont add if child already exists |
![]() |
void | AddParentsForTag
(
const FGameplayTag& Tag |
|
![]() |
void | AddTag
(
const FGameplayTag& TagToAdd |
Add the specified tag to the container |
![]() |
void | AddTagFast
(
const FGameplayTag& TagToAdd |
Add the specified tag to the container without checking for uniqueness |
![]() |
void | AppendMatchingTags
(
FGameplayTagContainer const& OtherA, |
Adds all the tags that match between the two specified containers to this container. |
![]() |
void | AppendTags
(
FGameplayTagContainer const& Other |
Adds all the tags from one container to this container NOTE: From set theory, this effectively is the union of the container this is called on with Other. |
![]() ![]() |
bool | ComplexHasTag
(
FGameplayTag const& TagToCheck, |
|
![]() ![]() |
TArray< FGameplayTag >::TConstIterator | Creates a const iterator for the contents of this array | |
![]() ![]() |
FGameplayTagContainer | CreateFromArray
(
const TArray< FGameplayTag, AllocatorType >& SourceTags |
Creates a container from an array of tags, this is more efficient than adding them all individually |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | DoesTagContainerMatch
(
const FGameplayTagContainer& OtherContainer, |
|
![]() |
void | Fills in ParentTags from GameplayTags | |
![]() ![]() |
FGameplayTagContainer | Filter
(
const FGameplayTagContainer& OtherContainer |
Returns a filtered version of this container, returns all tags that match against any of the tags in OtherContainer, expanding parents |
![]() ![]() |
FGameplayTagContainer | FilterExact
(
const FGameplayTagContainer& OtherContainer |
Returns a filtered version of this container, returns all tags that match exactly one in OtherContainer |
![]() ![]() |
FGameplayTag | First () |
|
![]() |
void | FromExportString
(
const FString& ExportString, |
Sets from a ImportText string, used in asset registry |
![]() ![]() |
FGameplayTag | GetByIndex
(
int32 Index |
|
![]() ![]() |
void | GetGameplayTagArray
(
TArray< FGameplayTag >& InOutGameplayTags |
Gets the explicit list of gameplay tags |
![]() ![]() |
const TArray< FGameplayTag > & | Gets the explicit list of gameplay tags | |
![]() ![]() |
FGameplayTagContainer | Returns a new container explicitly containing the tags of this container and all of their parent tags | |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasAll
(
const FGameplayTagContainer& ContainerToCheck |
Checks if this container contains ALL of the tags in the specified container, also checks against parent tags {"A.1","B.1"}.HasAll({"A","B"}) will return True, {"A","B"}.HasAll({"A.1","B.1"}) will return False If ContainerToCheck is empty/invalid it will always return True, because there were no failed checks |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasAllExact
(
const FGameplayTagContainer& ContainerToCheck |
Checks if this container contains ALL of the tags in the specified container, only allowing exact matches {"A.1","B.1"}.HasAll({"A","B"}) will return False If ContainerToCheck is empty/invalid it will always return True, because there were no failed checks |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasAny
(
const FGameplayTagContainer& ContainerToCheck |
Checks if this container contains ANY of the tags in the specified container, also checks against parent tags {"A.1"}.HasAny({"A","B"}) will return True, {"A"}.HasAny({"A.1","B"}) will return False If ContainerToCheck is empty/invalid it will always return False |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasAnyExact
(
const FGameplayTagContainer& ContainerToCheck |
Checks if this container contains ANY of the tags in the specified container, only allowing exact matches {"A.1"}.HasAny({"A","B"}) will return False If ContainerToCheck is empty/invalid it will always return False |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasTag
(
const FGameplayTag& TagToCheck |
Determine if TagToCheck is present in this container, also checking against parent tags {"A.1"}.HasTag("A") will return True, {"A"}.HasTag("A.1") will return False If TagToCheck is not Valid it will always return False |
![]() ![]() |
FORCEINLINE_DEBUGGABLE bool | HasTagExact
(
const FGameplayTag& TagToCheck |
Determine if TagToCheck is explicitly present in this container, only allowing exact matches {"A.1"}.HasTagExact("A") will return False If TagToCheck is not Valid it will always return False |
![]() ![]() |
PRAGMA_DISABLE_DEPRECATION_WARNINGS FORCEINLINE_DEBUGGABLE bool | HasTagFast
(
FGameplayTag const& TagToCheck, |
|
![]() |
bool | ImportTextItem
(
const TCHAR*& Buffer, |
Handles fixup after importing from text |
![]() ![]() |
bool | IsEmpty () |
Returns true if container is empty |
![]() ![]() |
bool | IsValid () |
Returns whether the container has any valid tags |
![]() ![]() |
bool | IsValidIndex
(
int32 Index |
|
![]() ![]() |
FGameplayTag | Last () |
|
![]() ![]() |
bool | MatchesQuery
(
const FGameplayTagQuery& Query |
Checks if this container matches the given query. |
![]() |
bool | NetSerialize
(
FArchive& Ar, |
Efficient network serialize, takes advantage of the dictionary |
![]() ![]() |
int32 | Num () |
Returns the number of explicitly added tags |
![]() |
void | Fill in the ParentTags array and any other transient parameters | |
![]() |
bool | RemoveTag
(
const FGameplayTag& TagToRemove, |
Tag to remove from the container |
![]() |
bool | RemoveTagByExplicitName
(
const FName& TagName |
If a Tag with the specified tag name explicitly exists, it will remove that tag and return true. |
![]() |
void | RemoveTags
(
const FGameplayTagContainer& TagsToRemove |
Removes all tags in TagsToRemove from this container |
![]() |
void | Reset
(
int32 Slack |
Remove all tags from the container. Will maintain slack by default |
![]() |
bool | Serialize
(
FStructuredArchive::FSlot Slot |
Serialize the tag container |
![]() ![]() |
FText | ToMatchingText
(
EGameplayContainerMatchType MatchType, |
Returns human readable description of what match is being looked for on the readable tag list. |
![]() ![]() |
FString | ToString () |
Returns string version of container in ImportText format |
![]() ![]() |
FString | ToStringSimple
(
bool bQuoted |
Returns abbreviated human readable Tag list without parens or property names. |
![]() ![]() |
TArray< FString > | ToStringsMaxLen
(
int32 MaxLen |
Returns abbreviated human readable Tag list without parens or property names, but will limit each string to specified len. |
Operators
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
bool | operator!=
(
FGameplayTagContainer const& Other |
|
![]() |
FGameplayTagContainer & | operator=
(
FGameplayTagContainer const& Other |
Assignment/Equality operators |
![]() |
FGameplayTagContainer & | operator=
(
FGameplayTagContainer&& Other |
|
![]() ![]() |
bool | operator==
(
FGameplayTagContainer const& Other |
Constants
Name | Description |
---|---|
EmptyContainer | An empty Gameplay Tag Container |