Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 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());
 }
Esempio n. 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));
 }
Esempio n. 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);
 }
Esempio n. 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));
 }