예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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());
 }
예제 #5
0
 public static bool NullOrVoid(this HUMType.Data.Is isData)
 {
     return(isData.type == typeof(void) || isData.type == null);
 }
예제 #6
0
 /// <summary>
 /// Returns true if the type is a void.
 /// </summary>
 public static bool Void(this HUMType.Data.Is isData)
 {
     return(isData.type == typeof(void));
 }
예제 #7
0
 /// <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);
 }
예제 #8
0
 /// <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));
 }