Add Tags.Find utility

#2492
This commit is contained in:
Wojtek Figat
2024-04-26 19:06:39 +02:00
parent aaadf3065d
commit 5e5497ff18
2 changed files with 12 additions and 0 deletions

View File

@@ -55,6 +55,11 @@ Tag Tags::Get(const StringView& tagName)
return tag;
}
Tag Tags::Find(const StringView& tagName)
{
return Tag(List.Find(tagName) + 1);
}
Array<Tag> Tags::GetSubTags(Tag parentTag)
{
Array<Tag> subTags;

View File

@@ -92,6 +92,13 @@ API_CLASS(Static) class FLAXENGINE_API Tags
/// <returns>The tag.</returns>
API_FUNCTION() static Tag Get(const StringView& tagName);
/// <summary>
/// Gets the tag. Returns empty one if it doesn't exist.
/// </summary>
/// <param name="tagName">The tag name.</param>
/// <returns>The tag (might be empty).</returns>
API_FUNCTION() static Tag Find(const StringView& tagName);
/// <summary>
/// Get all subtags of the specific Tag
/// </summary>