Table of Contents

Class BaseGangZone

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Provides the shared data and functionality of a gang zone, regardless of whether it is global (GangZone) or scoped to a single player (PlayerGangZone).

public abstract class BaseGangZone : IdProvider
Inheritance
BaseGangZone
Derived
Inherited Members

Constructors

BaseGangZone(IOmpEntityProvider, IGangZonesComponent, IGangZone)

Initializes a new instance of the BaseGangZone class.

protected BaseGangZone(IOmpEntityProvider entityProvider, IGangZonesComponent gangZones, IGangZone gangZone)

Parameters

entityProvider IOmpEntityProvider
gangZones IGangZonesComponent
gangZone IGangZone

Properties

Color

Gets or sets the Color of this gang zone.

public virtual Color Color { get; set; }

Property Value

Color

IsOmpEntityDestroyed

Gets a value indicating whether the open.mp entity counterpart has been destroyed.

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

Max

Gets the maximum position of this gang zone as a Vector2.

public virtual Vector2 Max { get; }

Property Value

Vector2

MaxX

Gets the maximum x coordinate of this gang zone.

public virtual float MaxX { get; }

Property Value

float

MaxY

Gets the maximum y coordinate of this gang zone.

public virtual float MaxY { get; }

Property Value

float

Min

Gets the minimum position of this gang zone as a Vector2.

public virtual Vector2 Min { get; }

Property Value

Vector2

MinX

Gets the minimum x coordinate of this gang zone.

public virtual float MinX { get; }

Property Value

float

MinY

Gets the minimum y coordinate of this gang zone.

public virtual float MinY { get; }

Property Value

float

Methods

Flash(Color)

Flashes this gang zone to all players.

public virtual void Flash(Color color)

Parameters

color Color

The Color to flash.

Flash(Player, Color)

Flashes this gang zone for the specified player.

public virtual void Flash(Player player, Color color)

Parameters

player Player

The Player to flash this gang zone to.

color Color

The Color to flash.

GetColorForPlayer(Player)

Gets the color with which this gang zone is shown for the specified player.

public virtual Color GetColorForPlayer(Player player)

Parameters

player Player

The player.

Returns

Color

The per-player gang zone color.

GetFlashingColorForPlayer(Player)

Gets the flashing color for this gang zone as seen by the specified player.

public virtual Color GetFlashingColorForPlayer(Player player)

Parameters

player Player

The player.

Returns

Color

The per-player flashing color.

GetShownFor()

Enumerates the players for whom this gang zone is currently shown.

public virtual IEnumerable<Player> GetShownFor()

Returns

IEnumerable<Player>

A lazy sequence of Player components.

Hide()

Hides this gang zone for all players.

public virtual void Hide()

Hide(Player)

Hides this gang zone for the specified player.

public virtual void Hide(Player player)

Parameters

player Player

The Player to hide this gang zone from.

IsFlashingForPlayer(Player)

Checks whether this gang zone is currently flashing for the specified player.

public virtual bool IsFlashingForPlayer(Player player)

Parameters

player Player

The player.

Returns

bool

true if flashing; otherwise false.

IsPlayerInside(Player)

Checks whether the specified player is inside this gang zone.

public virtual bool IsPlayerInside(Player player)

Parameters

player Player

The player.

Returns

bool

true if the player is inside; otherwise false.

Remarks

Requires that this gang zone has been registered for enter/leave checking via UseGangZoneCheck(BaseGangZone, bool), otherwise the result is always false.

IsShownForPlayer(Player)

Checks whether this gang zone is currently shown for the specified player.

public virtual bool IsShownForPlayer(Player player)

Parameters

player Player

The player.

Returns

bool

true if shown; otherwise false.

OnDestroyComponent()

This method is invoked before this component is destroyed and removed from its entity.

protected override void OnDestroyComponent()

SetPosition(Vector2, Vector2)

Updates the boundary of this gang zone.

public virtual void SetPosition(Vector2 min, Vector2 max)

Parameters

min Vector2

The minimum corner.

max Vector2

The maximum corner.

Show()

Shows this gang zone to all players.

public virtual void Show()

Show(Player)

Shows this gang zone to the specified player.

public virtual void Show(Player player)

Parameters

player Player

The Player to show this gang zone to.

StopFlash()

Stops this gang zone from flashing for all players.

public virtual void StopFlash()

StopFlash(Player)

Stops this gang zone from flashing for the specified player.

public virtual void StopFlash(Player player)

Parameters

player Player

The Player to stop the gang zone flash for.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator IGangZone(BaseGangZone?)

Performs an implicit conversion from BaseGangZone to IGangZone.

public static implicit operator IGangZone(BaseGangZone? gangZone)

Parameters

gangZone BaseGangZone

Returns

IGangZone