mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-04 17:14:42 +00:00
TreeNodeExtensions - Added constraints to generic type
This commit is contained in:
@@ -9,12 +9,12 @@ namespace PckStudio.Extensions
|
||||
{
|
||||
internal static class TreeNodeExtensions
|
||||
{
|
||||
internal static bool IsTagOfType<T>(this TreeNode node)
|
||||
internal static bool IsTagOfType<T>(this TreeNode node) where T : class
|
||||
{
|
||||
return node.Tag is T;
|
||||
}
|
||||
|
||||
internal static bool TryGetTagData<TOut>(this TreeNode node, out TOut tagData)
|
||||
internal static bool TryGetTagData<TOut>(this TreeNode node, out TOut tagData) where TOut : class
|
||||
{
|
||||
if (node?.Tag is TOut _data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user