示例#1
0
        protected static bool IsValidLot(Lot lot, FoodTruckBase truck)
        {
            if (lot == null) return false;

            FoodTruckBase existing = TruckController.GetTruck(lot);
            if (existing != null)
            {
                if (existing != truck) return false;
            }

            if (lot.StreetParking == null) return false;

            if (lot.IsWorldLot) return false;

            if (!lot.IsCommunityLot)
            {
                if (lot.Household == null) return false;

                if (!Traffic.Settings.mAllowIceCreamResidential) return false;

                if (lot.Household.IsActive)
                {
                    if (!Traffic.Settings.mAllowIceCreamActiveLot) return false;
                }
            }

            return true;
       }
示例#2
0
        protected static bool IsValidLot(Lot lot, FoodTruckBase truck)
        {
            if (lot == null)
            {
                return(false);
            }

            FoodTruckBase existing = TruckController.GetTruck(lot);

            if (existing != null)
            {
                if (existing != truck)
                {
                    return(false);
                }
            }

            if (lot.StreetParking == null)
            {
                return(false);
            }

            if (lot.IsWorldLot)
            {
                return(false);
            }

            if (Traffic.Settings.mRequireFoodParkingSpace)
            {
                List <FoodTruckBase> trucks = new List <FoodTruckBase>(lot.GetObjects <FoodTruckBase>());
                trucks.Remove(truck);

                if ((lot.CountObjects <WideParkingSpace>() == 0x0) || (trucks.Count > 0x0))
                {
                    return(false);
                }
            }

            if (lot.IsCommunityLot)
            {
                float openHour    = 0f;
                float closingHour = 0f;
                if ((Bartending.TryGetHoursOfOperation(lot, ref openHour, ref closingHour)) && (!SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, openHour, closingHour)))
                {
                    return(false);
                }
            }
            else
            {
                if (lot.Household == null)
                {
                    return(false);
                }

                if (!Traffic.Settings.mAllowFoodTruckResidential)
                {
                    return(false);
                }

                if (lot.Household.IsActive)
                {
                    if (!Traffic.Settings.mAllowFoodTruckActiveLot)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }