Table of Contents

Struct IPlayerObjectData

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

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

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

Constructors

IPlayerObjectData(nint)

Initializes a new instance of the IPlayerObjectData struct.

public IPlayerObjectData(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

AsPool()

Gets the pool interface for managing player objects.

public IPool<IPlayerObject> AsPool()

Returns

IPool<IPlayerObject>

A pool interface for player objects.

BeginEditing(IObject)

Begins editing the specified object.

public void BeginEditing(IObject objekt)

Parameters

objekt IObject

The object to edit.

BeginEditing(IPlayerObject)

Begins editing the specified player object.

public void BeginEditing(IPlayerObject objekt)

Parameters

objekt IPlayerObject

The player object to edit.

BeginSelecting()

Begins the object selection process.

public void BeginSelecting()

Bounds()

Gets the bounds of the pool.

public (Size, Size) Bounds()

Returns

(Size, Size)

A tuple containing the lower and upper bounds of the pool.

Count()

Gets the number of elements in the pool.

public Size Count()

Returns

Size

The number of elements in the pool.

Create(int, Vector3, Vector3, float)

Creates a new player object with the specified model ID, position, and rotation.

public IPlayerObject Create(int modelID, Vector3 position, Vector3 rotation, float drawDist = 0)

Parameters

modelID int

The model ID of the object.

position Vector3

The position of the object.

rotation Vector3

The rotation of the object.

drawDist float

The draw distance of the object. Defaults to 0.

Returns

IPlayerObject

A new instance of IPlayerObject.

EditAttachedObject(int)

Edits the attached object at the specified index.

public void EditAttachedObject(int index)

Parameters

index int

The index of the attachment slot to edit.

EditingObject()

Checks if an object is currently being edited.

public bool EditingObject()

Returns

bool

true if an object is being edited; otherwise, false.

EndEditing()

Ends the object editing process.

public void EndEditing()

Equals(IPlayerObjectData)

public bool Equals(IPlayerObjectData other)

Parameters

other IPlayerObjectData

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

Get(int)

Gets the element at the specified index.

public IPlayerObject Get(int index)

Parameters

index int

The index of the element to retrieve.

Returns

IPlayerObject

The element at the specified index.

GetAttachedObject(int)

Gets the attached object data for the specified index.

public ref ObjectAttachmentSlotData GetAttachedObject(int index)

Parameters

index int

The index of the attachment slot.

Returns

ObjectAttachmentSlotData

A reference to the ObjectAttachmentSlotData for the specified index.

GetEnumerator()

Gets an enumerator that iterates through the pool.

public IPool<IPlayerObject>.Enumerator GetEnumerator()

Returns

IPool<IPlayerObject>.Enumerator

An enumerator for the pool.

GetHashCode()

public override int GetHashCode()

Returns

int

GetPoolEventDispatcher()

Gets the event dispatcher for the pool.

public IEventDispatcher<IPoolEventHandler<IPlayerObject>> GetPoolEventDispatcher()

Returns

IEventDispatcher<IPoolEventHandler<IPlayerObject>>

An IEventDispatcher<T> for handling pool events.

HasAttachedObject(int)

Checks if an object is attached at the specified index.

public bool HasAttachedObject(int index)

Parameters

index int

The index to check.

Returns

bool

true if an object is attached; otherwise, false.

Lock(int)

Locks the element at the specified index.

public void Lock(int index)

Parameters

index int

The index of the element to lock.

Release(int)

Releases the element at the specified index.

public void Release(int index)

Parameters

index int

The index of the element to release.

RemoveAttachedObject(int)

Removes the attached object at the specified index.

public void RemoveAttachedObject(int index)

Parameters

index int

The index of the attachment slot to remove.

SelectingObject()

Checks if an object is currently being selected.

public bool SelectingObject()

Returns

bool

true if an object is being selected; otherwise, false.

SetAttachedObject(int, ref ObjectAttachmentSlotData)

Sets the attached object data for the specified index.

public void SetAttachedObject(int index, ref ObjectAttachmentSlotData data)

Parameters

index int

The index of the attachment slot.

data ObjectAttachmentSlotData

The attachment data to set.

Unlock(int)

Unlocks the element at the specified index.

public bool Unlock(int index)

Parameters

index int

The index of the element to unlock.

Returns

bool

true if the element was successfully unlocked; otherwise, false.

Operators

operator ==(IPlayerObjectData, object?)

Determines whether the specified values are equal.

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

Parameters

lhs IPlayerObjectData

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 IPlayerObjectData(IExtension)

Casts the IExtension to a IPlayerObjectData.

public static explicit operator IPlayerObjectData(IExtension value)

Parameters

value IExtension

The IExtension to cast.

Returns

IPlayerObjectData

The converted IPlayerObjectData.

explicit operator IExtension(IPlayerObjectData)

Casts the IPlayerObjectData to a IExtension.

public static explicit operator IExtension(IPlayerObjectData value)

Parameters

value IPlayerObjectData

The IPlayerObjectData to cast.

Returns

IExtension

The converted IExtension.

explicit operator IPool<IPlayerObject>(IPlayerObjectData)

Casts the IPlayerObjectData to a IPool<T>.

public static explicit operator IPool<IPlayerObject>(IPlayerObjectData value)

Parameters

value IPlayerObjectData

The IPlayerObjectData to cast.

Returns

IPool<IPlayerObject>

The converted IPool<T>.

explicit operator IPlayerObjectData(IPool<IPlayerObject>)

Casts the IPool<T> to a IPlayerObjectData.

public static explicit operator IPlayerObjectData(IPool<IPlayerObject> value)

Parameters

value IPool<IPlayerObject>

The IPool<T> to cast.

Returns

IPlayerObjectData

The converted IPlayerObjectData.

operator !=(IPlayerObjectData, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs IPlayerObjectData

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.

Explicit Interface Implementations

ExtensionId

Gets the identifier of the extension type. IPool<T>

static UID ExtensionId { get; }

Returns

UID