예제 #1
0
        protected static void PopulateLotList(List<IceCreamTruckManager.LotData> data)
        {
            foreach (Lot lot in LotManager.AllLots)
            {
                if (!IsValidLot(lot, null)) continue;

                IceCreamTruckManager.LotData item = new IceCreamTruckManager.LotData(lot);

                item.mDistanceReduction = 0f;

                float openHour = 0f;
                float closingHour = 0f;
                if (lot.LotType == LotType.Commercial)
                {
                    if ((Bartending.TryGetHoursOfOperation(lot, ref openHour, ref closingHour)) && (SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, openHour, closingHour)))
                    {
                        if (lot.CountObjects<ISchoolRabbitHole>() > 0x0)
                        {
                            item.mDistanceReduction += IceCreamTruckManager.kSchoolLotDistanceReduction;
                        }
                    }
                }

                if (lot.Household != null)
                {
                    item.mDistanceReduction += lot.Household.GetNumberOfKids() * IceCreamTruckManager.kKidsLotDistanceReduction;
                    if (lot.Household.IsActive)
                    {
                        item.mDistanceReduction += IceCreamTruckManager.kSelectableSimLotDistanceReduction;
                    }
                }

                switch (lot.CommercialLotSubType)
                {
                    case CommercialLotSubType.kSmallPark:
                    case CommercialLotSubType.kBigPark:
                    case CommercialLotSubType.kEP5_DogPark:
                    case CommercialLotSubType.kEP5_CatJungle:
                    case CommercialLotSubType.kEP11_RecreationPark:
                        item.mDistanceReduction += IceCreamTruckManager.kParkLotDistanceReduction;
                        break;
                }

                data.Add(item);
            }
        }