Struct IPickupsComponent
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
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()
Converts this component to a pool.
public IPool<IPickup> AsPool()
Returns
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
modelIdintThe model ID of the pickup.
typebyteThe type of the pickup.
posVector3The position where the pickup will be created.
virtualWorlduintThe virtual world ID for the pickup.
isStaticboolWhether the pickup is static and cannot be moved.
Returns
- IPickup
The created pickup, or
nullif creation failed.
Equals(IPickupsComponent)
public bool Equals(IPickupsComponent other)
Parameters
otherIPickupsComponent
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
FromLegacyID(int)
Converts a legacy pickup ID to its real ID equivalent.
public int FromLegacyID(int legacy)
Parameters
legacyintThe 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
ReleaseLegacyID(int)
Releases a legacy pickup ID that was previously reserved.
public void ReleaseLegacyID(int legacy)
Parameters
legacyintThe 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
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
realintThe 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
lhsIPickupsComponentThe 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 IPickupsComponent(IComponent)
Casts the IComponent to a IPickupsComponent.
public static explicit operator IPickupsComponent(IComponent value)
Parameters
valueIComponentThe 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
valueIPickupsComponentThe IPickupsComponent to cast.
Returns
- IComponent
The converted IComponent.
explicit operator IPoolComponent<IPickup>(IPickupsComponent)
Casts the IPickupsComponent to a IPoolComponent<T>.
public static explicit operator IPoolComponent<IPickup>(IPickupsComponent value)
Parameters
valueIPickupsComponentThe IPickupsComponent to cast.
Returns
- IPoolComponent<IPickup>
The converted IPoolComponent<T>.
explicit operator IPickupsComponent(IPoolComponent<IPickup>)
Casts the IPoolComponent<T> to a IPickupsComponent.
public static explicit operator IPickupsComponent(IPoolComponent<IPickup> value)
Parameters
valueIPoolComponent<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
lhsIPickupsComponentThe 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
ComponentId
Gets the identifier of the component type.
static UID ComponentId { get; }
Returns
FromComponentHandle(nint)
Casts a handle from a IComponent handle to a handle of this type.
static nint FromComponentHandle(nint handle)
Parameters
handlenintThe IComponent handle.
Returns
- nint
The handle of this type.