Table of Contents

Struct IGangZonesComponent

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

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

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

Constructors

IGangZonesComponent(nint)

Initializes a new instance of the IGangZonesComponent struct.

public IGangZonesComponent(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<IGangZone> AsPool()

Returns

IPool<IGangZone>

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(GangZonePos)

Creates a new gang zone.

public IGangZone Create(GangZonePos pos)

Parameters

pos GangZonePos

The position/boundaries of the gang zone.

Returns

IGangZone

The created gang zone, or null if creation failed.

Equals(IGangZonesComponent)

public bool Equals(IGangZonesComponent other)

Parameters

other IGangZonesComponent

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

FromLegacyID(int)

Converts a legacy gang zone ID to its real ID equivalent.

public int FromLegacyID(int legacy)

Parameters

legacy int

The legacy gang zone ID.

Returns

int

The real gang zone ID.

GetCheckingGangZones()

Gets the set of gang zones that have enter/leave checking enabled.

public FlatPtrHashSet<IGangZone> GetCheckingGangZones()

Returns

FlatPtrHashSet<IGangZone>

A collection of gang zones with checking enabled.

GetComponentType()

Gets the type of the component.

public ComponentType GetComponentType()

Returns

ComponentType

The component type.

GetEventDispatcher()

Gets the event dispatcher for gang zone events.

public IEventDispatcher<IGangZoneEventHandler> GetEventDispatcher()

Returns

IEventDispatcher<IGangZoneEventHandler>

An event dispatcher for IGangZoneEventHandler events.

GetHashCode()

public override int GetHashCode()

Returns

int

ReleaseLegacyID(int)

Releases a legacy gang zone ID that was previously reserved.

public void ReleaseLegacyID(int legacy)

Parameters

legacy int

The legacy gang zone ID to release.

ReserveLegacyID()

Reserves an unused legacy gang zone ID.

public int ReserveLegacyID()

Returns

int

A reserved legacy gang zone ID.

SetLegacyID(int, int)

Assigns a real gang zone ID to a previously reserved legacy ID.

public void SetLegacyID(int legacy, int real)

Parameters

legacy int

The legacy gang zone ID.

real int

The real gang zone 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 gang zone ID to its legacy ID equivalent.

public int ToLegacyID(int real)

Parameters

real int

The real gang zone ID.

Returns

int

The legacy gang zone ID.

UseGangZoneCheck(IGangZone, bool)

Enables or disables enter/leave checking for a gang zone.

public void UseGangZoneCheck(IGangZone zone, bool enable)

Parameters

zone IGangZone

The gang zone to configure.

enable bool

true to enable checking; false to disable it.

Operators

operator ==(IGangZonesComponent, object?)

Determines whether the specified values are equal.

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

Parameters

lhs IGangZonesComponent

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

public static explicit operator IGangZonesComponent(IComponent value)

Parameters

value IComponent

The IComponent to cast.

Returns

IGangZonesComponent

The converted IGangZonesComponent.

explicit operator IComponent(IGangZonesComponent)

public static explicit operator IComponent(IGangZonesComponent value)

Parameters

value IGangZonesComponent

The IGangZonesComponent to cast.

Returns

IComponent

The converted IComponent.

explicit operator IPoolComponent<IGangZone>(IGangZonesComponent)

public static explicit operator IPoolComponent<IGangZone>(IGangZonesComponent value)

Parameters

value IGangZonesComponent

The IGangZonesComponent to cast.

Returns

IPoolComponent<IGangZone>

The converted IPoolComponent<T>.

explicit operator IGangZonesComponent(IPoolComponent<IGangZone>)

public static explicit operator IGangZonesComponent(IPoolComponent<IGangZone> value)

Parameters

value IPoolComponent<IGangZone>

The IPoolComponent<T> to cast.

Returns

IGangZonesComponent

The converted IGangZonesComponent.

operator !=(IGangZonesComponent, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs IGangZonesComponent

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.