Table of Contents

Struct IBaseGangZone

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

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

[OpenMpApi(new Type[] { typeof(IExtensible), typeof(IIDProvider) })]
public readonly struct IBaseGangZone : IEquatable<IBaseGangZone>, IBaseGangZone.IManagedInterface, IExtensible.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
Implements
Inherited Members

Constructors

IBaseGangZone(nint)

Initializes a new instance of the IBaseGangZone struct.

public IBaseGangZone(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

AddExtension<T>(T)

Adds the specified managed extension to this extensible.

public void AddExtension<T>(T extension) where T : Extension

Parameters

extension T

An instance of the extension to add. The extension will be disposed if the extension could not be added to this extensible.

Type Parameters

T

The type of the managed extension.

Remarks

A managed extension can only be added to one extensible.

Exceptions

ArgumentException

Throw when an instance of the extension type was already added to this extensible.

Equals(IBaseGangZone)

public bool Equals(IBaseGangZone other)

Parameters

other IBaseGangZone

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

FlashForPlayer(IPlayer, ref Colour)

Starts flashing the gangzone for the specified player with the given colour.

public void FlashForPlayer(IPlayer player, ref Colour colour)

Parameters

player IPlayer

The player to flash the gangzone for.

colour Colour

The colour to flash the gangzone with.

GetColourForPlayer(IPlayer)

Gets the colour of the gangzone for the specified player.

public Colour GetColourForPlayer(IPlayer player)

Parameters

player IPlayer

The player to get the colour for.

Returns

Colour

The colour of the gangzone for the player.

GetExtension(UID)

Gets the extension with the specified id.

public IExtension GetExtension(UID id)

Parameters

id UID

The identifier of the extension type.

Returns

IExtension

The extension or null if the extension could not be found.

GetExtension<T>()

Gets the specified managed extension from this extensible.

public T GetExtension<T>() where T : Extension

Returns

T

An instance of the extension with type T.

Type Parameters

T

The type of the managed extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

GetFlashingColourForPlayer(IPlayer)

Gets the flashing colour of the gangzone for the specified player.

public Colour GetFlashingColourForPlayer(IPlayer player)

Parameters

player IPlayer

The player to get the flashing colour for.

Returns

Colour

The flashing colour of the gangzone for the player.

GetHashCode()

public override int GetHashCode()

Returns

int

GetID()

Gets the identifier of this unit.

public int GetID()

Returns

int

The identifier of the unit.

GetLegacyPlayer()

Gets the legacy player associated with this gangzone, used for ID mapping in per-player gangzones.

public IPlayer GetLegacyPlayer()

Returns

IPlayer

The associated legacy player, or null if not set.

GetPosition()

Gets the position of the gangzone.

public GangZonePos GetPosition()

Returns

GangZonePos

A GangZonePos structure containing the minimum and maximum coordinates.

GetShownFor()

Gets a list of players the gangzone is shown for.

public FlatPtrHashSet<IPlayer> GetShownFor()

Returns

FlatPtrHashSet<IPlayer>

A collection of players the gangzone is visible to.

HideForPlayer(IPlayer)

Hides the gangzone for the specified player.

public void HideForPlayer(IPlayer player)

Parameters

player IPlayer

The player to hide the gangzone for.

IsFlashingForPlayer(IPlayer)

Checks if the gangzone is flashing for the specified player.

public bool IsFlashingForPlayer(IPlayer player)

Parameters

player IPlayer

The player to check for.

Returns

bool

true if the gangzone is flashing for the player; otherwise, false.

IsPlayerInside(IPlayer)

Checks if the specified player is within the gangzone bounds.

public bool IsPlayerInside(IPlayer player)

Parameters

player IPlayer

The player to check.

Returns

bool

true if the player is inside the gangzone; otherwise, false.

Remarks

This only works if the gangzone has been added to the checking list via IGangZonesComponent.UseGangZoneCheck.

IsShownForPlayer(IPlayer)

Checks if the gangzone is shown for the specified player.

public bool IsShownForPlayer(IPlayer player)

Parameters

player IPlayer

The player to check for.

Returns

bool

true if the gangzone is shown for the player; otherwise, false.

QueryExtension<T>()

Gets the specified unmanaged extension from this extensible.

public T QueryExtension<T>() where T : unmanaged, IExtension.IManagedInterface

Returns

T

The unmanaged extension or null if the extension could not be found.

Type Parameters

T

The type of the unmanaged extension.

RemoveExtension(IExtension)

Removes the specified extension from this extensible.

public void RemoveExtension(IExtension extension)

Parameters

extension IExtension

The extension to remove.

Exceptions

ArgumentException

Thrown if the extension could not be found.

RemoveExtension(UID)

Removes the extension with the specified id from this extensible.

public void RemoveExtension(UID id)

Parameters

id UID

The identifier of the extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

RemoveExtension<T>(T)

Removes the specified managed extension from this extensible.

public void RemoveExtension<T>(T extension) where T : Extension

Parameters

extension T

The managed extension to remove.

Type Parameters

T

The type of the managed extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

SetLegacyPlayer(IPlayer)

Sets the legacy player for this gangzone, used for ID mapping in per-player gangzones.

public void SetLegacyPlayer(IPlayer player)

Parameters

player IPlayer

The player to associate with this gangzone, or null.

SetPosition(ref GangZonePos)

Sets the position of the gangzone.

public void SetPosition(ref GangZonePos position)

Parameters

position GangZonePos

A GangZonePos structure containing the minimum and maximum coordinates.

ShowForPlayer(IPlayer, ref Colour)

Shows the gangzone to the specified player with the given colour.

public void ShowForPlayer(IPlayer player, ref Colour colour)

Parameters

player IPlayer

The player to show the gangzone to.

colour Colour

The colour to display the gangzone with.

StopFlashForPlayer(IPlayer)

Stops flashing the gangzone for the specified player.

public void StopFlashForPlayer(IPlayer player)

Parameters

player IPlayer

The player to stop flashing the gangzone for.

TryGetExtension<T>()

Tries to get the specified managed extension from this extensible.

public T? TryGetExtension<T>() where T : Extension

Returns

T

An instance of the extension with type T or null if no extension with the specified type could be found.

Type Parameters

T

The type of the managed extension.

TryQueryExtension<T>(out T)

Tries to get the specified unmanaged extension from this extensible.

public bool TryQueryExtension<T>(out T extension) where T : unmanaged, IExtension.IManagedInterface

Parameters

extension T

The extension if found, otherwise null.

Returns

bool

true if the extension was found; false otherwise.

Type Parameters

T

The type of the unmanaged extension.

Operators

operator ==(IBaseGangZone, object?)

Determines whether the specified values are equal.

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

Parameters

lhs IBaseGangZone

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 IExtensible(IBaseGangZone)

Casts the IBaseGangZone to a IExtensible.

public static explicit operator IExtensible(IBaseGangZone value)

Parameters

value IBaseGangZone

The IBaseGangZone to cast.

Returns

IExtensible

The converted IExtensible.

explicit operator IIDProvider(IBaseGangZone)

Casts the IBaseGangZone to a IIDProvider.

public static explicit operator IIDProvider(IBaseGangZone value)

Parameters

value IBaseGangZone

The IBaseGangZone to cast.

Returns

IIDProvider

The converted IIDProvider.

explicit operator IBaseGangZone(IExtensible)

Casts the IExtensible to a IBaseGangZone.

public static explicit operator IBaseGangZone(IExtensible value)

Parameters

value IExtensible

The IExtensible to cast.

Returns

IBaseGangZone

The converted IBaseGangZone.

explicit operator IBaseGangZone(IIDProvider)

Casts the IIDProvider to a IBaseGangZone.

public static explicit operator IBaseGangZone(IIDProvider value)

Parameters

value IIDProvider

The IIDProvider to cast.

Returns

IBaseGangZone

The converted IBaseGangZone.

operator !=(IBaseGangZone, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs IBaseGangZone

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.