engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | Protected 成员函数 | Protected 属性 | 友元 | 所有成员列表
FGameplayTagContainer结构体 参考

A Tag Container holds a collection of FGameplayTags, tags are included explicitly by adding them, and implicitly from adding child tags 更多...

#include <GameplayTagContainer.h>

Public 成员函数

bool AddLeafTag (const FGameplayTag &TagToAdd)
 Adds a tag to the container and removes any direct parents, wont add if child already exists 更多...
 
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, FGameplayTagContainer const &OtherB)
 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, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > TagToCheckMatchType) const
 Determine if the container has the specified tag 更多...
 
TArray< FGameplayTag >::TConstIterator CreateConstIterator () const
 Creates a const iterator for the contents of this array
 
FORCEINLINE_DEBUGGABLE bool DoesTagContainerMatch (const FGameplayTagContainer &OtherContainer, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > OtherTagMatchType, EGameplayContainerMatchType ContainerMatchType) const
 Returns true if the tags in this container match the tags in OtherContainer for the specified matching types. 更多...
 
 FGameplayTagContainer ()
 Constructors
 
 FGameplayTagContainer (const FGameplayTag &Tag)
 Explicit to prevent people from accidentally using the wrong type of operation
 
void FillParentTags ()
 Fills in ParentTags from GameplayTags
 
FGameplayTagContainer Filter (const FGameplayTagContainer &OtherContainer) const
 Returns a filtered version of this container, returns all tags that match against any of the tags in OtherContainer, expanding parents 更多...
 
FGameplayTagContainer Filter (const FGameplayTagContainer &OtherContainer, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > OtherTagMatchType) const
 Returns a filtered version of this container, as if the container were filtered by matches from the parameter container 更多...
 
FGameplayTagContainer FilterExact (const FGameplayTagContainer &OtherContainer) const
 Returns a filtered version of this container, returns all tags that match exactly one in OtherContainer 更多...
 
void FromExportString (const FString &ExportString)
 Sets from a ImportText string, used in asset registry
 
void GetGameplayTagArray (TArray< FGameplayTag > &InOutGameplayTags) const
 Gets the explicit list of gameplay tags
 
FGameplayTagContainer GetGameplayTagParents () const
 Returns a new container explicitly containing the tags of this container and all of their parent tags
 
FORCEINLINE_DEBUGGABLE bool HasAll (const FGameplayTagContainer &ContainerToCheck) const
 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) const
 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) const
 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) const
 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) const
 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 HasTag (FGameplayTag const &TagToCheck, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > TagToCheckMatchType) const
 Determine if the container has the specified tag 更多...
 
FORCEINLINE_DEBUGGABLE bool HasTagExact (const FGameplayTag &TagToCheck) const
 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 更多...
 
FORCEINLINE_DEBUGGABLE bool HasTagExplicit (FGameplayTag const &TagToCheck) const
 Determine if the container has the specified tag. 更多...
 
FORCEINLINE_DEBUGGABLE bool HasTagFast (FGameplayTag const &TagToCheck, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > TagToCheckMatchType) const
 Version of above that is called from conditions where you know tag is valid
 
bool ImportTextItem (const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText)
 Handles fixup after importing from text
 
FORCEINLINE bool IsEmpty () const
 Returns true if container is empty
 
FORCEINLINE bool IsValid () const
 Returns whether the container has any valid tags
 
FORCEINLINE_DEBUGGABLE bool MatchesAll (const FGameplayTagContainer &Other, bool bCountEmptyAsMatch) const
 Checks if this container matches ALL of the tags in the specified container. 更多...
 
FORCEINLINE_DEBUGGABLE bool MatchesAny (const FGameplayTagContainer &Other, bool bCountEmptyAsMatch) const
 Checks if this container matches ANY of the tags in the specified container. 更多...
 
bool MatchesQuery (const struct FGameplayTagQuery &Query) const
 Checks if this container matches the given query. 更多...
 
bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 Efficient network serialize, takes advantage of the dictionary
 
FORCEINLINE int32 Num () const
 Returns the number of explicitly added tags
 
FGameplayTagContainer & operator= (FGameplayTagContainer const &Other)
 Assignment/Equality operators
 
void PostScriptConstruct ()
 Fill in the ParentTags array and any other transient parameters
 
bool RemoveTag (const FGameplayTag &TagToRemove, bool bDeferParentTags=false)
 Tag to remove from the container 更多...
 
void RemoveTags (const FGameplayTagContainer &TagsToRemove)
 Removes all tags in TagsToRemove from this container 更多...
 
void Reset (int32 Slack=0)
 Remove all tags from the container. 更多...
 
bool Serialize (FStructuredArchive::FSlot Slot)
 Serialize the tag container
 
FText ToMatchingText (EGameplayContainerMatchType MatchType, bool bInvertCondition) const
 Returns human readable description of what match is being looked for on the readable tag list.
 
FString ToString () const
 Returns string version of container in ImportText format
 
FString ToStringSimple (bool bQuoted=false) const
 Returns abbreviated human readable Tag list without parens or property names. 更多...
 
TArray< FString > ToStringsMaxLen (int32 MaxLen) const
 Returns abbreviated human readable Tag list without parens or property names, but will limit each string to specified len. 更多...
 

静态 Public 成员函数

template<class AllocatorType >
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
 

静态 Public 属性

static const FGameplayTagContainer EmptyContainer
 An empty Gameplay Tag Container
 

Protected 成员函数

void AddParentsForTag (const FGameplayTag &Tag)
 Adds parent tags for a single tag
 
bool DoesTagContainerMatchComplex (const FGameplayTagContainer &OtherContainer, TEnumAsByte< EGameplayTagMatchType::Type > TagMatchType, TEnumAsByte< EGameplayTagMatchType::Type > OtherTagMatchType, EGameplayContainerMatchType ContainerMatchType) const
 Returns true if the tags in this container match the tags in OtherContainer for the specified matching types. 更多...
 
bool RemoveTagByExplicitName (const FName &TagName)
 If a Tag with the specified tag name explicitly exists, it will remove that tag and return true. 更多...
 

Protected 属性

TArray< FGameplayTag > GameplayTags
 Array of gameplay tags
 
TArray< FGameplayTag > ParentTags
 Array of expanded parent tags, in addition to GameplayTags. 更多...
 

友元

FORCEINLINE friend TArray< FGameplayTag >::TConstIterator begin (const FGameplayTagContainer &Array)
 DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
 
struct FGameplayTag
 
struct FGameplayTagNode
 
struct FGameplayTagQuery
 
class UGameplayTagsManager
 

详细描述

A Tag Container holds a collection of FGameplayTags, tags are included explicitly by adding them, and implicitly from adding child tags

成员函数说明

◆ AddLeafTag()

bool FGameplayTagContainer::AddLeafTag ( const FGameplayTag &  TagToAdd)

Adds a tag to the container and removes any direct parents, wont add if child already exists

参数
TagThe tag to try and add to this container
返回
True if tag was added

◆ AddTag()

void FGameplayTagContainer::AddTag ( const FGameplayTag &  TagToAdd)

Add the specified tag to the container

参数
TagToAddTag to add to the container

◆ AddTagFast()

void FGameplayTagContainer::AddTagFast ( const FGameplayTag &  TagToAdd)

Add the specified tag to the container without checking for uniqueness

参数
TagToAddTag to add to the container

Useful when building container from another data struct (TMap for example)

◆ AppendMatchingTags()

void FGameplayTagContainer::AppendMatchingTags ( FGameplayTagContainer const &  OtherA,
FGameplayTagContainer const &  OtherB 
)

Adds all the tags that match between the two specified containers to this container.

WARNING: This matches any parent tag in A, not just exact matches! So while this should be the union of the container this is called on with the intersection of OtherA and OtherB, it's not exactly that. Since OtherB matches against its parents, any tag in OtherA which has a parent match with a parent of OtherB will count. For example, if OtherA has Color.Green and OtherB has Color.Red, that will count as a match due to the Color parent match! If you want an exact match, you need to call A.FilterExact(B) (above) to get the intersection of A with B. If you need the disjunctive union (the union of two sets minus their intersection), use AppendTags to create Union, FilterExact to create Intersection, and then call Union.RemoveTags(Intersection).

参数
OtherATagContainer that has the matching tags you want to add to this container, these tags have their parents expanded
OtherBTagContainer used to check for matching tags. If the tag matches on any parent, it counts as a match.

◆ AppendTags()

void FGameplayTagContainer::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.

参数
OtherTagContainer that has the tags you want to add to this container

◆ ComplexHasTag()

bool FGameplayTagContainer::ComplexHasTag ( FGameplayTag const &  TagToCheck,
TEnumAsByte< EGameplayTagMatchType::Type >  TagMatchType,
TEnumAsByte< EGameplayTagMatchType::Type >  TagToCheckMatchType 
) const

Determine if the container has the specified tag

参数
TagToCheckTag to check if it is present in the container
TagMatchTypeType of match to use for the tags in this container
TagToCheckMatchTypeType of match to use for the TagToCheck Param
返回
True if the tag is in the container, false if it is not

◆ DoesTagContainerMatch()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::DoesTagContainerMatch ( const FGameplayTagContainer &  OtherContainer,
TEnumAsByte< EGameplayTagMatchType::Type >  TagMatchType,
TEnumAsByte< EGameplayTagMatchType::Type >  OtherTagMatchType,
EGameplayContainerMatchType  ContainerMatchType 
) const
inline

Returns true if the tags in this container match the tags in OtherContainer for the specified matching types.

参数
OtherContainerThe Container to filter against
TagMatchTypeType of match to use for the tags in this container
OtherTagMatchTypeType of match to use for the tags in the OtherContainer param
ContainerMatchTypeType of match to use for filtering
返回
Returns true if ContainerMatchType is Any and any of the tags in OtherContainer match the tags in this or ContainerMatchType is All and all of the tags in OtherContainer match at least one tag in this. Returns false otherwise.

◆ DoesTagContainerMatchComplex()

bool FGameplayTagContainer::DoesTagContainerMatchComplex ( const FGameplayTagContainer &  OtherContainer,
TEnumAsByte< EGameplayTagMatchType::Type >  TagMatchType,
TEnumAsByte< EGameplayTagMatchType::Type >  OtherTagMatchType,
EGameplayContainerMatchType  ContainerMatchType 
) const
protected

Returns true if the tags in this container match the tags in OtherContainer for the specified matching types.

参数
OtherContainerThe Container to filter against
TagMatchTypeType of match to use for the tags in this container
OtherTagMatchTypeType of match to use for the tags in the OtherContainer param
ContainerMatchTypeType of match to use for filtering
返回
Returns true if ContainerMatchType is Any and any of the tags in OtherContainer match the tags in this or ContainerMatchType is All and all of the tags in OtherContainer match at least one tag in this. Returns false otherwise.

◆ Filter() [1/2]

FGameplayTagContainer FGameplayTagContainer::Filter ( const FGameplayTagContainer &  OtherContainer) const

Returns a filtered version of this container, returns all tags that match against any of the tags in OtherContainer, expanding parents

参数
OtherContainerThe Container to filter against
返回
A FGameplayTagContainer containing the filtered tags

◆ Filter() [2/2]

FGameplayTagContainer FGameplayTagContainer::Filter ( const FGameplayTagContainer &  OtherContainer,
TEnumAsByte< EGameplayTagMatchType::Type >  TagMatchType,
TEnumAsByte< EGameplayTagMatchType::Type >  OtherTagMatchType 
) const

Returns a filtered version of this container, as if the container were filtered by matches from the parameter container

参数
OtherContainerThe Container to filter against
TagMatchTypeType of match to use for the tags in this container
OtherTagMatchTypeType of match to use for the tags in the OtherContainer param
返回
A FGameplayTagContainer containing the filtered tags

◆ FilterExact()

FGameplayTagContainer FGameplayTagContainer::FilterExact ( const FGameplayTagContainer &  OtherContainer) const

Returns a filtered version of this container, returns all tags that match exactly one in OtherContainer

参数
OtherContainerThe Container to filter against
返回
A FGameplayTagContainer containing the filtered tags

◆ HasAll()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasAll ( const FGameplayTagContainer &  ContainerToCheck) const
inline

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

返回
True if this container has ALL of the tags of in ContainerToCheck, including if ContainerToCheck is empty

◆ HasAllExact()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasAllExact ( const FGameplayTagContainer &  ContainerToCheck) const
inline

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

返回
True if this container has ALL of the tags of in ContainerToCheck, including if ContainerToCheck is empty

◆ HasAny()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasAny ( const FGameplayTagContainer &  ContainerToCheck) const
inline

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

返回
True if this container has ANY of the tags of in ContainerToCheck

◆ HasAnyExact()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasAnyExact ( const FGameplayTagContainer &  ContainerToCheck) const
inline

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

返回
True if this container has ANY of the tags of in ContainerToCheck

◆ HasTag() [1/2]

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasTag ( const FGameplayTag &  TagToCheck) const
inline

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

返回
True if TagToCheck is in this container, false if it is not

◆ HasTag() [2/2]

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasTag ( FGameplayTag const &  TagToCheck,
TEnumAsByte< EGameplayTagMatchType::Type >  TagMatchType,
TEnumAsByte< EGameplayTagMatchType::Type >  TagToCheckMatchType 
) const
inline

Determine if the container has the specified tag

参数
TagToCheckTag to check if it is present in the container
TagMatchTypeType of match to use for the tags in this container
TagToCheckMatchTypeType of match to use for the TagToCheck Param
返回
True if the tag is in the container, false if it is not

◆ HasTagExact()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasTagExact ( const FGameplayTag &  TagToCheck) const
inline

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

返回
True if TagToCheck is in this container, false if it is not

◆ HasTagExplicit()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::HasTagExplicit ( FGameplayTag const &  TagToCheck) const
inline

Determine if the container has the specified tag.

This forces an explicit match. This function exists for convenience and brevity. We do not wish to use default values for HasTag match type parameters, to avoid confusion on what the default behavior is. (E.g., we want people to think and use the right match type).

参数
TagToCheckTag to check if it is present in the container
返回
True if the tag is in the container, false if it is not

◆ MatchesAll()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::MatchesAll ( const FGameplayTagContainer &  Other,
bool  bCountEmptyAsMatch 
) const
inline

Checks if this container matches ALL of the tags in the specified container.

Performs matching by expanding this container out to include its parent tags.

参数
OtherContainer we are checking against
bCountEmptyAsMatchIf true, the parameter tag container will count as matching even if it's empty
返回
True if this container has ALL the tags of the passed in container

◆ MatchesAny()

FORCEINLINE_DEBUGGABLE bool FGameplayTagContainer::MatchesAny ( const FGameplayTagContainer &  Other,
bool  bCountEmptyAsMatch 
) const
inline

Checks if this container matches ANY of the tags in the specified container.

Performs matching by expanding this container out to include its parent tags.

参数
OtherContainer we are checking against
bCountEmptyAsMatchIf true, the parameter tag container will count as matching even if it's empty
返回
True if this container has ANY the tags of the passed in container

◆ MatchesQuery()

bool FGameplayTagContainer::MatchesQuery ( const struct FGameplayTagQuery &  Query) const

Checks if this container matches the given query.

参数
QueryQuery we are checking against
返回
True if this container matches the query, false otherwise.

◆ RemoveTag()

bool FGameplayTagContainer::RemoveTag ( const FGameplayTag &  TagToRemove,
bool  bDeferParentTags = false 
)

Tag to remove from the container

参数
TagToRemoveTag to remove from the container
bDeferParentTagsSkip calling FillParentTags for performance (must be handled by calling code)

◆ RemoveTagByExplicitName()

bool FGameplayTagContainer::RemoveTagByExplicitName ( const FName &  TagName)
protected

If a Tag with the specified tag name explicitly exists, it will remove that tag and return true.

Otherwise, it returns false. It does NOT check the TagName for validity (i.e. the tag could be obsolete and so not exist in the table). It also does NOT check parents (because it cannot do so for a tag that isn't in the table). NOTE: This function should ONLY ever be used by GameplayTagsManager when redirecting tags. Do NOT make this function public!

◆ RemoveTags()

void FGameplayTagContainer::RemoveTags ( const FGameplayTagContainer &  TagsToRemove)

Removes all tags in TagsToRemove from this container

参数
TagsToRemoveTags to remove from the container

◆ Reset()

void FGameplayTagContainer::Reset ( int32  Slack = 0)

Remove all tags from the container.

Will maintain slack by default

◆ ToStringSimple()

FString FGameplayTagContainer::ToStringSimple ( bool  bQuoted = false) const

Returns abbreviated human readable Tag list without parens or property names.

If bQuoted is true it will quote each tag

◆ ToStringsMaxLen()

TArray< FString > FGameplayTagContainer::ToStringsMaxLen ( int32  MaxLen) const

Returns abbreviated human readable Tag list without parens or property names, but will limit each string to specified len.

This is to get around output restrictions

类成员变量说明

◆ ParentTags

TArray<FGameplayTag> FGameplayTagContainer::ParentTags
protected

Array of expanded parent tags, in addition to GameplayTags.

Used to accelerate parent searches. May contain duplicates in some cases


该结构体的文档由以下文件生成: