From c111fff32bd05ebd7fdd8eaee22fa96f15c417af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Mon, 1 Jan 2024 13:02:50 +0100 Subject: [PATCH] ScriptCore: Added extension Type.IsAssignableTo --- ScriptCore/Extensions/TypeExtension.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ScriptCore/Extensions/TypeExtension.cs diff --git a/ScriptCore/Extensions/TypeExtension.cs b/ScriptCore/Extensions/TypeExtension.cs new file mode 100644 index 0000000..b6fc91a --- /dev/null +++ b/ScriptCore/Extensions/TypeExtension.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GlitchyEngine.Extensions; + +public static class TypeExtension +{ + /// + /// Determines whether the current type can be assigned to a variable of the specified . + /// + /// The type to compare with the current type. + /// + public static bool IsAssignableTo(this Type type, Type targetType) + { + return targetType.IsAssignableFrom(type); + } +}