Class BaseGangZone
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
entityProviderIOmpEntityProvidergangZonesIGangZonesComponentgangZoneIGangZone
Properties
Color
Gets or sets the Color of this gang zone.
public virtual Color Color { get; set; }
Property Value
IsOmpEntityDestroyed
Gets a value indicating whether the open.mp entity counterpart has been destroyed.
protected bool IsOmpEntityDestroyed { get; }
Property Value
Max
Gets the maximum position of this gang zone as a Vector2.
public virtual Vector2 Max { get; }
Property Value
MaxX
Gets the maximum x coordinate of this gang zone.
public virtual float MaxX { get; }
Property Value
MaxY
Gets the maximum y coordinate of this gang zone.
public virtual float MaxY { get; }
Property Value
Min
Gets the minimum position of this gang zone as a Vector2.
public virtual Vector2 Min { get; }
Property Value
MinX
Gets the minimum x coordinate of this gang zone.
public virtual float MinX { get; }
Property Value
MinY
Gets the minimum y coordinate of this gang zone.
public virtual float MinY { get; }
Property Value
Methods
Flash(Color)
Flashes this gang zone to all players.
public virtual void Flash(Color color)
Parameters
Flash(Player, Color)
Flashes this gang zone for the specified player.
public virtual void Flash(Player player, Color color)
Parameters
GetColorForPlayer(Player)
Gets the color with which this gang zone is shown for the specified player.
public virtual Color GetColorForPlayer(Player player)
Parameters
playerPlayerThe 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
playerPlayerThe 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
IsFlashingForPlayer(Player)
Checks whether this gang zone is currently flashing for the specified player.
public virtual bool IsFlashingForPlayer(Player player)
Parameters
playerPlayerThe player.
Returns
IsPlayerInside(Player)
Checks whether the specified player is inside this gang zone.
public virtual bool IsPlayerInside(Player player)
Parameters
playerPlayerThe player.
Returns
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
playerPlayerThe player.
Returns
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
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
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
ToString()
public override string ToString()
Returns
Operators
implicit operator IGangZone(BaseGangZone?)
Performs an implicit conversion from BaseGangZone to IGangZone.
public static implicit operator IGangZone(BaseGangZone? gangZone)
Parameters
gangZoneBaseGangZone