Table of Contents

Struct IPickupsComponent

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

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

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

Constructors

IPickupsComponent(nint)

Initializes a new instance of the IPickupsComponent struct.

public IPickupsComponent(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()

Converts this component to a pool.

public IPool<IPickup> AsPool()

Returns

IPool<IPickup>

A pool.

ComponentName()

Gets the name of the component.

public string ComponentName()

Returns

string

The component name.

ComponentVersion()

Gets the version of the component.

public SemanticVersion ComponentVersion()

Returns

SemanticVersion

The component version.

Create(int, byte, Vector3, uint, bool)

Creates a new pickup.

public IPickup Create(int modelId, byte type, Vector3 pos, uint virtualWorld, bool isStatic)

Parameters

modelId int

The model ID of the pickup.

type byte

The type of the pickup.

pos Vector3

The position where the pickup will be created.

virtualWorld uint

The virtual world ID for the pickup.

isStatic bool

Whether the pickup is static and cannot be moved.

Returns

IPickup

The created pickup, or null if creation failed.

Equals(IPickupsComponent)

public bool Equals(IPickupsComponent other)

Parameters

other IPickupsComponent

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

FromLegacyID(int)

Converts a legacy pickup ID to its real ID equivalent.

public int FromLegacyID(int legacy)

Parameters

legacy int

The legacy pickup ID.

Returns

int

The real pickup ID.

GetComponentType()

Gets the type of the component.

public ComponentType GetComponentType()

Returns

ComponentType

The component type.

GetEventDispatcher()

Gets the event dispatcher for pickup events.

public IEventDispatcher<IPickupEventHandler> GetEventDispatcher()

Returns

IEventDispatcher<IPickupEventHandler>

An event dispatcher for IPickupEventHandler events.

GetHashCode()

public override int GetHashCode()

Returns

int

ReleaseLegacyID(int)

Releases a legacy pickup ID that was previously reserved.

public void ReleaseLegacyID(int legacy)

Parameters

legacy int

The legacy pickup ID to release.

ReserveLegacyID()

Reserves an unused legacy pickup ID.

public int ReserveLegacyID()

Returns

int

A reserved legacy pickup ID.

SetLegacyID(int, int)

Assigns a real pickup ID to a previously reserved legacy ID.

public void SetLegacyID(int legacy, int real)

Parameters

legacy int

The legacy pickup ID.

real int

The real pickup ID to assign.

SupportedVersion()

Gets the supported version of the component.

public int SupportedVersion()

Returns

int

The supported version of the component.

Remarks

The idea is for the SDK to be totally forward compatible, so code built at any time will always work, thanks to ABI compatibility. This method is an emergency trap door, just in case that's ever not the problem. Check which major version this component was built for, if it isn't the current major version, fail to load it. Always just returns a constant, recompiling will often be enough to upgrade. virtual and final to be the vtable, but it can't be overridden because it is a constant.

ToLegacyID(int)

Converts a real pickup ID to its legacy ID equivalent.

public int ToLegacyID(int real)

Parameters

real int

The real pickup ID.

Returns

int

The legacy pickup ID.

Operators

operator ==(IPickupsComponent, object?)

Determines whether the specified values are equal.

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

Parameters

lhs IPickupsComponent

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 IPickupsComponent(IComponent)

Casts the IComponent to a IPickupsComponent.

public static explicit operator IPickupsComponent(IComponent value)

Parameters

value IComponent

The IComponent to cast.

Returns

IPickupsComponent

The converted IPickupsComponent.

explicit operator IComponent(IPickupsComponent)

Casts the IPickupsComponent to a IComponent.

public static explicit operator IComponent(IPickupsComponent value)

Parameters

value IPickupsComponent

The IPickupsComponent to cast.

Returns

IComponent

The converted IComponent.

explicit operator IPoolComponent<IPickup>(IPickupsComponent)

public static explicit operator IPoolComponent<IPickup>(IPickupsComponent value)

Parameters

value IPickupsComponent

The IPickupsComponent to cast.

Returns

IPoolComponent<IPickup>

The converted IPoolComponent<T>.

explicit operator IPickupsComponent(IPoolComponent<IPickup>)

public static explicit operator IPickupsComponent(IPoolComponent<IPickup> value)

Parameters

value IPoolComponent<IPickup>

The IPoolComponent<T> to cast.

Returns

IPickupsComponent

The converted IPickupsComponent.

operator !=(IPickupsComponent, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs IPickupsComponent

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

ComponentId

Gets the identifier of the component type.

static UID ComponentId { get; }

Returns

UID

FromComponentHandle(nint)

Casts a handle from a IComponent handle to a handle of this type.

static nint FromComponentHandle(nint handle)

Parameters

handle nint

The IComponent handle.

Returns

nint

The handle of this type.