/// <summary> /// Возвращает информацию об машинах полиции /// </summary> private static IEnumerable <CommonVehicle> GetVehiclesInfo() { var infos = PoliceDataGetter.GetVehiclePositions(); return(infos.Select(info => new CommonVehicle { Hash = info.Hash, VehicleType = POLICE_VEHICLE_KEY, SpawnPosition = info.Position, SpawnRotation = info.Rotation, Fuel = MAX_FUEL, MaxFuel = MAX_FUEL, MainColor = 111 }).ToList()); }
/// <summary> /// Запускает таймер, генерящий события патрулирования /// </summary> public void RunAlertsGenerator() { ActionHelper.StartTimer(120000, () => { var expiredAlerts = _policeAlerts.Where(e => (DateTime.Now - e.Date).TotalMinutes >= 30).ToList(); foreach (var alert in expiredAlerts) { FinishAlert(alert.Id); } if (_policeAlerts.Count < MAX_FAKE_ALERTS) { var position = PoliceDataGetter.GetAlertPosition(); CreateAlert(position, PATROL_ALERT); } }); }