public void RefreshLines()
        {
            if (Singleton <BuildingManager> .exists)
            {
                int count        = 0;
                var buildingList = SVMBuildingUtils.getAllBuildingsFromCity(Singleton <T> .instance.GetSSD());

                SVMUtils.doLog("{0} buildingList = [{1}] (s={2})", GetType(), string.Join(",", buildingList.Select(x => x.ToString()).ToArray()), buildingList.Count);
                foreach (ushort buildingID in buildingList)
                {
                    Building b             = Singleton <BuildingManager> .instance.m_buildings.m_buffer[buildingID];
                    var      ext           = SVMBuildingAIOverrideUtils.getBuildingOverrideExtension(b.Info);
                    var      maxCountField = ext.GetVehicleMaxCountField(SVMSysDef <T> .instance.GetSSD().vehicleType);
                    var      maxVehicle    = SVMUtils.GetPrivateField <int>(b.Info.GetAI(), maxCountField);
                    if (maxCountField == null || maxVehicle > 0)
                    {
                        AddToList(buildingID, ref count);
                    }
                }
                RemoveExtraLines(count);
                SVMUtils.doLog("{0} final count = {1}", GetType(), count);

                m_LinesUpdated = true;
            }
        }
        protected virtual bool ProcessOffer(ushort buildingID, ref Building data, TransferManager.TransferReason material, TransferManager.TransferOffer offer, TransferManager.TransferReason trTarget, StartTransferCallStructure tup, U instance)
        {
            if (material == trTarget)
            {
                ServiceSystemDefinition def = ServiceSystemDefinition.from(instance.m_info, tup.vehicleType);
                if (def == null)
                {
                    SVMUtils.doLog("SSD Não definido para: {0} {1} {2} {3}", instance.m_info.m_class.m_service, instance.m_info.m_class.m_subService, tup.vehicleLevel ?? instance.m_info.m_class.m_level, tup.vehicleType);
                    return(false);
                }

                #region District Check
                var ext = def.GetTransportExtension();

                if (ext.GetAllowDistrictServiceRestrictions())
                {
                    var buildingDistrict = DistrictManager.instance.GetDistrict(data.m_position);
                    var offerDistrict    = DistrictManager.instance.GetDistrict(offer.Position);
                    if (buildingDistrict != offerDistrict)
                    {
                        if (ServiceVehiclesManagerMod.debugMode)
                        {
                            SVMUtils.doLog($"Building serving different district: building {data.Info} ({buildingID} - districtId {buildingDistrict} {DistrictManager.instance.GetDistrictName(buildingDistrict)}) => offerDistrict: {offerDistrict} {DistrictManager.instance.GetDistrictName(offerDistrict)}");
                        }
                        if (!ext.GetAllowOutsidersEffective(offerDistrict))
                        {
                            var districtBuildings = SVMBuildingUtils.getAllBuildingsFromCity(def, offerDistrict, true, true);

                            if (ServiceVehiclesManagerMod.debugMode)
                            {
                                SVMUtils.doLog($"Offer doesn't allow outsiders. Available buildings found: {districtBuildings}");
                            }
                            if (districtBuildings.Count > 0)
                            {
                                var newBuildingId = districtBuildings[Singleton <SimulationManager> .instance.m_randomizer.Int32((uint)districtBuildings.Count)];
                                return(ProcessOffer(newBuildingId, ref BuildingManager.instance.m_buildings.m_buffer[newBuildingId], material, offer, trTarget, tup, instance));
                            }
                            if (ServiceVehiclesManagerMod.debugMode)
                            {
                                SVMUtils.doLog($"Ignoring because no buildings can handle it");
                            }
                        }
                        if (!ext.GetAllowGoOutsideEffective(buildingDistrict))
                        {
                            var districtBuildings = SVMBuildingUtils.getAllBuildingsFromCity(def, offerDistrict, false, true);
                            if (ServiceVehiclesManagerMod.debugMode)
                            {
                                SVMUtils.doLog($"Building district doesn't allow go out. Available buildings found: {districtBuildings}");
                            }
                            if (districtBuildings.Count > 0)
                            {
                                var newBuildingId = districtBuildings[Singleton <SimulationManager> .instance.m_randomizer.Int32((uint)districtBuildings.Count)];
                                return(ProcessOffer(newBuildingId, ref BuildingManager.instance.m_buildings.m_buffer[newBuildingId], material, offer, trTarget, tup, instance));
                            }
                            if (ServiceVehiclesManagerMod.debugMode)
                            {
                                SVMUtils.doLog($"Ignoring because no buildings can handle it (2)");
                            }
                        }
                    }
                }
                #endregion

                SVMUtils.doLog("[{1}] SSD = {0}", def, material);
                VehicleInfo randomVehicleInfo = ServiceSystemDefinition.availableDefinitions[def].GetAModel(buildingID);
                SVMUtils.doLog("[{1}] Veh = {0}", randomVehicleInfo?.ToString() ?? "<NULL>", material);
                if (randomVehicleInfo != null)
                {
                    Array16 <Vehicle> vehicles = Singleton <VehicleManager> .instance.m_vehicles;
                    instance.CalculateSpawnPosition(buildingID, ref data, ref Singleton <SimulationManager> .instance.m_randomizer, randomVehicleInfo, out Vector3 position, out Vector3 vector2);
                    if (Singleton <VehicleManager> .instance.CreateVehicle(out ushort num, ref Singleton <SimulationManager> .instance.m_randomizer, randomVehicleInfo, position, material, tup.tramsferToSource, tup.transferToTarget))
                    {
                        randomVehicleInfo.m_vehicleAI.SetSource(num, ref vehicles.m_buffer[(int)num], buildingID);
                        randomVehicleInfo.m_vehicleAI.StartTransfer(num, ref vehicles.m_buffer[(int)num], material, offer);
                        return(true);
                    }
                }
            }
            return(false);
        }