/// <summary>
        /// Возвращает свободное место на парковке
        /// </summary>
        private Tuple <Vector3, Vector3> GetFreePlace()
        {
            var occupiedPlaces = VehicleManager.GetAllVehicles()
                                 .Where(e => e.hasData(ParkingFine.ON_PARKING_FINE))
                                 .Select(e => e.position).ToList();

            return(WreckerPositionsGetter.SpawnPlaces.FirstOrDefault(e => Parking.PlaceFree(occupiedPlaces, e.Item1)));
        }
Exemple #2
0
        /// <summary>
        /// Возвращает свободное место на парковке
        /// </summary>
        private Tuple <Vector3, Vector3> GetFreePlace()
        {
            var occupiedPlaces = VehicleManager.GetAllVehicles()
                                 .Where(e => e.hasData(ON_PARKING))
                                 .Select(e => e.position).ToList();

            return(_parkingPositions.FirstOrDefault(e => PlaceFree(occupiedPlaces, e.Item1)));
        }
Exemple #3
0
        /// <summary>
        /// Возвращает позицию угона
        /// </summary>
        internal static Tuple <Vector3, Vector3> GetHijackedPosition()
        {
            Tuple <Vector3, Vector3> result;
            var allVehicles = VehicleManager.GetAllVehicles(VehicleTheft.THIEFT_VEHICLE);
            var tries       = 0;

            do
            {
                result = tries < _hijackedVehiclesPositions.Count
                    ? _hijackedVehiclesPositions[ActionHelper.Random.Next(_hijackedVehiclesPositions.Count)]
                    : _hijackedVehiclesPositions.First();
                tries++;
            } while (allVehicles.Any(e => Vector3.Distance(e.position, result.Item1) < 2f));
            return(result);
        }
Exemple #4
0
        public IActionResult GetAllVehicles()
        {
            var allVehicles = manager.GetAllVehicles();

            return(Ok(Extended(allVehicles)));
        }