/// <summary> /// Gets the attach type of the given entity. If the entity is invalid <see cref="AttachType.None"/> is returned. /// </summary> /// <param name="entity">The wanted attach target entity</param> /// <returns>The associated attach type</returns> internal static AttachType GetTypeByEntity(Entity entity) { return(entity switch { Player _ => AttachType.Player, Vehicle _ => AttachType.Vehicle, Object _ => AttachType.Object, NPC _ => AttachType.NPC, _ => AttachType.None });
/// <summary> /// Creates an object in this dimension. /// </summary> /// <param name="model">The model of the object</param> /// <param name="pos">The position of the object</param> /// <param name="rot">The rotation of the object</param> /// <param name="scale">The scale of the object</param> /// <returns>The wrapped object</returns> public Object CreateObject(int model, Vector pos, Vector rot = null, Vector scale = null) { rot ??= Vector.Empty; scale ??= Vector.One; Object obj = _server.CreateObject(Onset.CreateObject(model, pos.X, pos.Y, pos.Z, rot.X, rot.Y, rot.Z, scale.X, scale.Y, scale.Z)); obj.SetDimension(Value); return(obj); }