Example #1
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));
        }
Example #2
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);
        }
Example #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));
 }
Example #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());
 }
Example #5
0
 public static bool NullOrVoid(this HUMType.Data.Is isData)
 {
     return(isData.type == typeof(void) || isData.type == null || isData.type == typeof(Lasm.UAlive.Void));
 }
Example #6
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);
 }
Example #7
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));
 }