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)); }
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()); }
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()); }
public bool IsDerivedType(Type_ compare_to) { Type_ search = this; while (search != null) { if (search == compare_to) { return(true); } search = search.BaseType; } return(false); }
public Item(double Length, Type_ Type) { this.Length = Length; this.Type = Type; }
/*! * 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);
/*! * 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);
public bool IsSameType(Type_ compare_to) => compare_to == this;
public Type_(Type_ src, Type_ baseType) { name = src.name; BaseType = src.BaseType; InternalTypeNumber = num_types++; }
public Type_(string name, Type_ baseType) { this.name = name; BaseType = baseType; InternalTypeNumber = num_types++; }
protected SteeringBehavior(MovingEntity entity, string name, SteeringBehavior.Type_ type) { _movingEntity = entity; BehaviorName = name; Type = type; }
/// <summary> /// Deprecated Method for adding a new object to the Type EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToType(Type_ type_) { base.AddObject("Type", type_); }
/// <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_; }