mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
ScriptCore: Added extension Type.IsAssignableTo
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace GlitchyEngine.Extensions;
|
||||||
|
|
||||||
|
public static class TypeExtension
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the current type can be assigned to a variable of the specified <see cref="targetType"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="targetType">The type to compare with the current type.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool IsAssignableTo(this Type type, Type targetType)
|
||||||
|
{
|
||||||
|
return targetType.IsAssignableFrom(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user