Navigation
API > API/Runtime > API/Runtime/GameplayTags
A Tag Container holds a collection of FGameplayTags, tags are included explicitly by adding them, and implicitly from adding child tags
| Name | FGameplayTagContainer |
| Type | struct |
| Header File | /Engine/Source/Runtime/GameplayTags/Classes/GameplayTagContainer.h |
| Include Path | #include "GameplayTagContainer.h" |
Syntax
USTRUCT (BlueprintType ,
Meta=(HasNativeMake="/Script/GameplayTags.BlueprintGameplayTagLibrary.MakeGameplayTagContainerFromArray", HasNativeBreak="/Script/GameplayTags.BlueprintGameplayTagLibrary.BreakGameplayTagContainer"))
struct FGameplayTagContainer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGameplayTagContainer
(
const FGameplayTag& Tag |
Explicit to prevent people from accidentally using the wrong type of operation | GameplayTagContainer.h | |
FGameplayTagContainer
(
FGameplayTagContainer&& Other |
GameplayTagContainer.h | ||
FGameplayTagContainer
(
FGameplayTagContainer const& Other |
GameplayTagContainer.h | ||
| Constructors | GameplayTagContainer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FGameplayTagContainer() |
GameplayTagContainer.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EmptyContainer | const FGameplayTagContainer | An empty Gameplay Tag Container | GameplayTagContainer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddLeafTag
(
const FGameplayTag& TagToAdd |
Adds a tag to the container and removes any direct parents, wont add if child already exists | GameplayTagContainer.h | |
void AddTag
(
const FGameplayTag& TagToAdd |
Add the specified tag to the container | GameplayTagContainer.h | |
void AddTagFast
(
const FGameplayTag& TagToAdd |
Add the specified tag to the container without checking for uniqueness | GameplayTagContainer.h | |
void AppendMatchingTags
(
FGameplayTagContainer const& OtherA, |
Adds all the tags that match between the two specified containers to this container. | GameplayTagContainer.h | |
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. | GameplayTagContainer.h | |
TArray< FGameplayTag >::TConstIterator CreateConstIterator() |
Creates a const iterator for the contents of this array | GameplayTagContainer.h | |
void FillParentTags() |
Fills in ParentTags from GameplayTags | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
FGameplayTagContainer FilterExact
(
const FGameplayTagContainer& OtherContainer |
Returns a filtered version of this container, returns all tags that match exactly one in OtherContainer | GameplayTagContainer.h | |
FGameplayTag First() |
GameplayTagContainer.h | ||
void FromExportString
(
const FString& ExportString, |
Sets from a ImportText string, used in asset registry | GameplayTagContainer.h | |
FGameplayTag GetByIndex
(
int32 Index |
GameplayTagContainer.h | ||
void GetGameplayTagArray
(
TArray< FGameplayTag >& InOutGameplayTags |
Gets the explicit list of gameplay tags | GameplayTagContainer.h | |
const TArray< FGameplayTag > & GetGameplayTagArray () |
Gets the explicit list of gameplay tags | GameplayTagContainer.h | |
FGameplayTagContainer GetGameplayTagParents() |
Returns a new container explicitly containing the tags of this container and all of their parent tags | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
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 | GameplayTagContainer.h | |
bool ImportTextItem
(
const TCHAR*& Buffer, |
Handles fixup after importing from text | GameplayTagContainer.h | |
bool IsEmpty() |
Returns true if container is empty | GameplayTagContainer.h | |
bool IsValid() |
Returns whether the container has any valid tags | GameplayTagContainer.h | |
bool IsValidIndex
(
int32 Index |
GameplayTagContainer.h | ||
FGameplayTag Last() |
GameplayTagContainer.h | ||
bool MatchesQuery
(
const FGameplayTagQuery& Query |
Checks if this container matches the given query. | GameplayTagContainer.h | |
bool NetSerialize
(
FArchive& Ar, |
Efficient network serialize, takes advantage of the dictionary | GameplayTagContainer.h | |
int32 Num() |
Returns the number of explicitly added tags | GameplayTagContainer.h | |
void PostScriptConstruct() |
Fill in the ParentTags array and any other transient parameters | GameplayTagContainer.h | |
bool RemoveTag
(
const FGameplayTag& TagToRemove, |
Tag to remove from the container | GameplayTagContainer.h | |
void RemoveTags
(
const FGameplayTagContainer& TagsToRemove |
Removes all tags in TagsToRemove from this container | GameplayTagContainer.h | |
void Reset
(
int32 Slack |
Remove all tags from the container. Will maintain slack by default | GameplayTagContainer.h | |
bool Serialize
(
FStructuredArchive::FSlot Slot |
Serialize the tag container | GameplayTagContainer.h | |
FText ToMatchingText
(
EGameplayContainerMatchType MatchType, |
Returns human readable description of what match is being looked for on the readable tag list. | GameplayTagContainer.h | |
FString ToString() |
Returns string version of container in ImportText format | GameplayTagContainer.h | |
FString ToStringSimple
(
bool bQuoted |
Returns abbreviated human readable Tag list without parens or property names. | GameplayTagContainer.h | |
TArray< FString > ToStringsMaxLen
(
int32 MaxLen |
Returns abbreviated human readable Tag list without parens or property names, but will limit each string to specified len. | GameplayTagContainer.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddParentsForTag
(
const FGameplayTag& Tag |
GameplayTagContainer.h | ||
bool RemoveTagByExplicitName
(
const FName& TagName |
If a Tag with the specified tag name explicitly exists, it will remove that tag and return true. | GameplayTagContainer.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FGameplayTagContainer CreateFromArray
(
const TArray< FGameplayTag, AllocatorType >& SourceTags |
Creates a container from an array of tags, this is more efficient than adding them all individually | GameplayTagContainer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
FGameplayTagContainer const& Other |
GameplayTagContainer.h | ||
FGameplayTagContainer & operator=
(
FGameplayTagContainer&& Other |
GameplayTagContainer.h | ||
FGameplayTagContainer & operator=
(
FGameplayTagContainer const& Other |
Assignment/Equality operators | GameplayTagContainer.h | |
bool operator==
(
FGameplayTagContainer const& Other |
GameplayTagContainer.h |