Struct IPlayerObjectData
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
handlenintA pointer to the unmanaged interface.
Properties
Handle
Gets the handle to the unmanaged interface instance.
public nint Handle { get; }
Property Value
HasValue
Gets a value indicating whether the pointer has a value.
public bool HasValue { get; }
Property Value
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
objektIObjectThe object to edit.
BeginEditing(IPlayerObject)
Begins editing the specified player object.
public void BeginEditing(IPlayerObject objekt)
Parameters
objektIPlayerObjectThe 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
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
modelIDintThe model ID of the object.
positionVector3The position of the object.
rotationVector3The rotation of the object.
drawDistfloatThe 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
indexintThe index of the attachment slot to edit.
EditingObject()
Checks if an object is currently being edited.
public bool EditingObject()
Returns
EndEditing()
Ends the object editing process.
public void EndEditing()
Equals(IPlayerObjectData)
public bool Equals(IPlayerObjectData other)
Parameters
otherIPlayerObjectData
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
Get(int)
Gets the element at the specified index.
public IPlayerObject Get(int index)
Parameters
indexintThe 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
indexintThe 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
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
indexintThe index to check.
Returns
Lock(int)
Locks the element at the specified index.
public void Lock(int index)
Parameters
indexintThe index of the element to lock.
Release(int)
Releases the element at the specified index.
public void Release(int index)
Parameters
indexintThe index of the element to release.
RemoveAttachedObject(int)
Removes the attached object at the specified index.
public void RemoveAttachedObject(int index)
Parameters
indexintThe index of the attachment slot to remove.
SelectingObject()
Checks if an object is currently being selected.
public bool SelectingObject()
Returns
SetAttachedObject(int, ref ObjectAttachmentSlotData)
Sets the attached object data for the specified index.
public void SetAttachedObject(int index, ref ObjectAttachmentSlotData data)
Parameters
indexintThe index of the attachment slot.
dataObjectAttachmentSlotDataThe attachment data to set.
Unlock(int)
Unlocks the element at the specified index.
public bool Unlock(int index)
Parameters
indexintThe index of the element to unlock.
Returns
Operators
operator ==(IPlayerObjectData, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPlayerObjectData lhs, object? rhs)
Parameters
lhsIPlayerObjectDataThe value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif the values are equal; otherwise,false.
explicit operator IPlayerObjectData(IExtension)
Casts the IExtension to a IPlayerObjectData.
public static explicit operator IPlayerObjectData(IExtension value)
Parameters
valueIExtensionThe 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
valueIPlayerObjectDataThe 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
valueIPlayerObjectDataThe 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
valueIPool<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
lhsIPlayerObjectDataThe value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif the values are not equal; otherwise,false.
Explicit Interface Implementations
ExtensionId
Gets the identifier of the extension type. IPool<T>
static UID ExtensionId { get; }