/// <summary> /// Returns true if the type is a enumerator collection type. /// </summary> public static bool Enumerator(this HUMType.Data.Is isData) { if (isData.type == typeof(IEnumerator) || isData.type == typeof(IEnumerable) || isData.type == typeof(IEnumerator <>) || isData.type == typeof(IEnumerable <>)) { return(true); } return(false); }
/// <summary> /// Returns true if the type is a Coroutine. /// </summary> public static bool Coroutine(this HUMType.Data.Is isData) { if (isData.type == typeof(IEnumerator) && isData.type != typeof(IEnumerable) && isData.type != typeof(IEnumerator <>) && isData.type != typeof(IEnumerable <>)) { return(true); } return(isData.type == typeof(Coroutine) || isData.type == typeof(YieldInstruction) || isData.type == typeof(CustomYieldInstruction)); }
/// <summary> /// Starts an operation where we determing if a type is a generic of some kind. /// </summary> public static HUMType.Data.Generic Generic(this HUMType.Data.Is isData) { return(new HUMType.Data.Generic(isData)); }
/// <summary> /// Returns true if the type is an enumerable collection type. /// </summary> public static bool Enumerable(this HUMType.Data.Is isData) { return(isData.type.Inherits(typeof(IEnumerator)) || isData.type.Inherits(typeof(IEnumerable)) || isData.type.Is().Generic().Enumerator() || isData.Enumerator()); }
public static bool NullOrVoid(this HUMType.Data.Is isData) { return(isData.type == typeof(void) || isData.type == null); }
/// <summary> /// Returns true if the type is a void. /// </summary> public static bool Void(this HUMType.Data.Is isData) { return(isData.type == typeof(void)); }
/// <summary> /// Returns true if a type is equal to another type. /// </summary> public static bool Type(this HUMType.Data.Is isData, Type type) { return(isData.type == type); }
/// <summary> /// Returns true if a type is equal to another type. /// </summary> public static bool Type <T>(this HUMType.Data.Is isData) { return(isData.type == typeof(T)); }