using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SAMP.API
{
public class GangZone
{
#region Class Variables
private int _nId;
private Vector2 _qMin, _qMax;
#endregion
#region Constructor
///
/// Creates a GangZone (colored radar area).
///
/// The south-west side of the gangzone. (X = west, Y = south).
/// The north-east side of the gangzone. (X = east, Y = north).
public GangZone(Vector2 min, Vector2 max)
{
_qMin = min;
_qMax = max;
_nId = Core.Natives.GangZoneCreate(min.X, min.Y, max.X, max.Y);
}
#endregion
#region Accessors & Mutators
///
/// Gets the ID of this GangZone.
///
internal int ID
{
get { return _nId; }
}
///
/// Gets the maximum position.
///
public Vector2 Maximum
{
get { return _qMax; }
}
///
/// Gets the minimum position.
///
public Vector2 Minimum
{
get { return _qMin; }
}
#endregion
#region Public Methods
///
/// Makes the GangZone flash for all players.
///
/// The color the zone will flash.
public void FlashForAll(Color color)
{
Core.Natives.GangZoneFlashForAll(this.ID, color.ToArgb());
}
///
/// Makes the GangZone flash for a player.
///
/// The player you would like to hide the GangZone for.
/// The color the zone will flash.
public void FlashForPlayer(Player player, Color color)
{
Core.Natives.GangZoneFlashForPlayer(player.ID, this.ID, color.ToArgb());
}
///
/// Hides the GangZone for all players.
///
/// The color for the GangZone to be.
public void HideForAll(Color color)
{
Core.Natives.GangZoneHideForAll(this.ID);
}
///
/// Hides the GangZone for a player.
///
/// The player you would like to hide the GangZone for.
/// The color for the GangZone to be.
public void HideForPlayer(Player player, Color color)
{
Core.Natives.GangZoneHideForPlayer(player.ID, this.ID);
}
///
/// Shows the GangZone for all players.
///
/// The color for the GangZone to be.
/// Returns a System.Boolean representing whether or not the GangZone was shown.
public bool ShowForAll(Color color)
{
return Core.Natives.GangZoneShowForAll(this.ID, color.ToArgb()) == 1;
}
///
/// Shows the GangZone for a player.
///
/// The player you would like to show the GangZone for.
/// The color for the GangZone to be.
public void ShowForPlayer(Player player, Color color)
{
Core.Natives.GangZoneShowForPlayer(player.ID, this.ID, color.ToArgb());
}
///
/// Stops the GangZone flashing for all players.
///
public void StopFlashForAll()
{
Core.Natives.GangZoneStopFlashForAll(this.ID);
}
///
/// Stops the GangZone flashing for a player.
///
/// The player you would like to hide the GangZone for.
public void StopFlashForPlayer(Player player)
{
Core.Natives.GangZoneStopFlashForPlayer(player.ID, this.ID);
}
#endregion
};
};