Table of Contents

Struct IEntity

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

This type represents a pointer to an unmanaged open.mp IEntity interface.

[OpenMpApi(new Type[] { typeof(IIDProvider) })]
public readonly struct IEntity : IEquatable<IEntity>, IEntity.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
Implements
Inherited Members

Constructors

IEntity(nint)

Initializes a new instance of the IEntity struct.

public IEntity(nint handle)

Parameters

handle nint

A pointer to the unmanaged interface.

Properties

Handle

Gets the handle to the unmanaged interface instance.

public nint Handle { get; }

Property Value

nint

HasValue

Gets a value indicating whether the pointer has a value.

public bool HasValue { get; }

Property Value

bool

Methods

Equals(IEntity)

public bool Equals(IEntity other)

Parameters

other IEntity

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetID()

Gets the identifier of this unit.

public int GetID()

Returns

int

The identifier of the unit.

GetPosition()

Gets the position of this entity.

public Vector3 GetPosition()

Returns

Vector3

The position of this entity.

GetRotation()

Gets the rotation of this entity.

public GTAQuat GetRotation()

Returns

GTAQuat

The rotation of this entity.

GetVirtualWorld()

Gets the virtual world of this entity.

public int GetVirtualWorld()

Returns

int

The virtual world of this entity.

SetPosition(Vector3)

Sets the position of this entity.

public void SetPosition(Vector3 position)

Parameters

position Vector3

The position to set.

SetRotation(GTAQuat)

Sets the rotation of this entity.

public void SetRotation(GTAQuat rotation)

Parameters

rotation GTAQuat

The rotation to set.

SetVirtualWorld(int)

Sets the virtual world of this entity.

public void SetVirtualWorld(int vw)

Parameters

vw int

The virtual world to set.

Operators

operator ==(IEntity, object?)

Determines whether the specified values are equal.

public static bool operator ==(IEntity lhs, object? rhs)

Parameters

lhs IEntity

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are equal; otherwise, false.

explicit operator IIDProvider(IEntity)

Casts the IEntity to a IIDProvider.

public static explicit operator IIDProvider(IEntity value)

Parameters

value IEntity

The IEntity to cast.

Returns

IIDProvider

The converted IIDProvider.

explicit operator IEntity(IIDProvider)

Casts the IIDProvider to a IEntity.

public static explicit operator IEntity(IIDProvider value)

Parameters

value IIDProvider

The IIDProvider to cast.

Returns

IEntity

The converted IEntity.

operator !=(IEntity, object?)

Determines whether the specified values are not equal.

public static bool operator !=(IEntity lhs, object? rhs)

Parameters

lhs IEntity

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are not equal; otherwise, false.