Struct IPoolComponent<T>
This type represents a pointer to an unmanaged open.mp IPoolComponent<T> interface.
[OpenMpApi(new Type[] { typeof(IComponent) })]
[OpenMpApiPartial]
public readonly struct IPoolComponent<T> : IEquatable<IPoolComponent<T>>, IUnmanagedInterface where T : unmanaged, IIDProvider.IManagedInterface
Type Parameters
T
- Implements
- Inherited Members
Constructors
IPoolComponent(nint)
Initializes a new instance of the IPoolComponent<T> struct.
public IPoolComponent(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<T> AsPool()
Returns
- IPool<T>
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.
Equals(IPoolComponent<T>)
public bool Equals(IPoolComponent<T> other)
Parameters
otherIPoolComponent<T>
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
FromComponentHandle(nint)
public static nint FromComponentHandle(nint handle)
Parameters
handlenint
Returns
GetComponentType()
Gets the type of the component.
public ComponentType GetComponentType()
Returns
- ComponentType
The component type.
GetHashCode()
public override int GetHashCode()
Returns
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.
Operators
operator ==(IPoolComponent<T>, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPoolComponent<T> lhs, object? rhs)
Parameters
lhsIPoolComponent<T>The 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 IPoolComponent<T>(IComponent)
Casts the IComponent to a IPoolComponent<T>.
public static explicit operator IPoolComponent<T>(IComponent value)
Parameters
valueIComponentThe IComponent to cast.
Returns
- IPoolComponent<T>
The converted IPoolComponent<T>.
explicit operator IComponent(IPoolComponent<T>)
Casts the IPoolComponent<T> to a IComponent.
public static explicit operator IComponent(IPoolComponent<T> value)
Parameters
valueIPoolComponent<T>The IPoolComponent<T> to cast.
Returns
- IComponent
The converted IComponent.
operator !=(IPoolComponent<T>, object?)
Determines whether the specified values are not equal.
public static bool operator !=(IPoolComponent<T> lhs, object? rhs)
Parameters
lhsIPoolComponent<T>The 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.