Exemple #1
0
 public static bool PrimitiveStringOrVoid(this HUMType.Data.Is @is)
 {
     if (@is.type == null)
     {
         return(false);
     }
     return(@is.type.IsPrimitive || @is.type == typeof(string) || @is.type == typeof(void) || @is.type.BaseType == null && @is.type == typeof(object));
 }
Exemple #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);
        }
Exemple #3
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));
        }
Exemple #4
0
 public static bool PrimitiveOrString(this HUMType.Data.Is @is)
 {
     return(@is.type.IsPrimitive || @is.type == typeof(string));
 }
Exemple #5
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));
 }
Exemple #6
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());
 }
Exemple #7
0
 public static bool NullOrVoid(this HUMType.Data.Is isData)
 {
     return(isData.type == typeof(void) || isData.type == null);
 }
Exemple #8
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));
 }
Exemple #9
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);
 }
Exemple #10
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));
 }