예제 #1
0
        public static Item Calculate(Item source, Type_ toConvert)
        {
            // Calculate difference:
            int difference = (int)source.Type - (int)toConvert;

            return(new Item(Math.Round(difference < 0 ? source.Length / Math.Pow(1024, (int)Math.Abs(difference)) : source.Length *Math.Pow(1024, (int)Math.Abs(difference)), 2), toConvert));
        }
예제 #2
0
            public static Type[] FromTSObject(dynamic[] tsArray)
            {
                if (tsArray is null)
                {
                    return(null);
                }
                var list = new System.Collections.Generic.List <Type>();

                foreach (var tsItem in tsArray)
                {
                    list.Add(Type_.FromTSObject(tsItem));
                }
                return(list.ToArray());
            }
예제 #3
0
            public static dynamic GetTSObject(Type[] dynArray)
            {
                if (dynArray is null)
                {
                    return(null);
                }
                var list = new System.Collections.Generic.List <dynamic>();

                foreach (var dynItem in dynArray)
                {
                    list.Add(Type_.GetTSObject(dynItem));
                }
                return(list.ToArray());
            }
예제 #4
0
        public bool IsDerivedType(Type_ compare_to)
        {
            Type_ search = this;

            while (search != null)
            {
                if (search == compare_to)
                {
                    return(true);
                }
                search = search.BaseType;
            }
            return(false);
        }
예제 #5
0
 public Item(double Length, Type_ Type)
 {
     this.Length = Length;
     this.Type   = Type;
 }
예제 #6
0
 /*!
  * Used to determine whether this object is a derived type of the given type constant.  For example, all NIF objects are derived types of NiObject, and a NiNode is also a derived type of NiObjectNET and NiAVObject.
  * \return True if this object is derived from the type represented by the given type constant.  False otherwise.
  */
 public bool IsDerivedType(Type_ compare_to) => GetType().IsDerivedType(compare_to);
예제 #7
0
 /*!
  * Used to determine whether this object is exactly the same type as the given type constant.
  * \return True if this object is exactly the same type as that represented by the given type constant.  False otherwise.
  */
 public bool IsSameType(Type_ compare_to) => GetType().IsSameType(compare_to);
예제 #8
0
 public bool IsSameType(Type_ compare_to) => compare_to == this;
예제 #9
0
 public Type_(Type_ src, Type_ baseType)
 {
     name               = src.name;
     BaseType           = src.BaseType;
     InternalTypeNumber = num_types++;
 }
예제 #10
0
 public Type_(string name, Type_ baseType)
 {
     this.name          = name;
     BaseType           = baseType;
     InternalTypeNumber = num_types++;
 }
예제 #11
0
 protected SteeringBehavior(MovingEntity entity, string name, SteeringBehavior.Type_ type)
 {
     _movingEntity = entity;
     BehaviorName  = name;
     Type          = type;
 }
예제 #12
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Type EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToType(Type_ type_)
 {
     base.AddObject("Type", type_);
 }
예제 #13
0
 /// <summary>
 /// Create a new Type_ object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="type1">Initial value of the type1 property.</param>
 public static Type_ CreateType_(global::System.Int32 id, global::System.String type1)
 {
     Type_ type_ = new Type_();
     type_.id = id;
     type_.type1 = type1;
     return type_;
 }