private void DestroyBuildings(IEnumerable <ushort> abandonedBuildingIds)
 {
     foreach (var buildingId in abandonedBuildingIds)
     {
         if (_buildingObserver.BuildingsIds.Contains(buildingId))
         {
             _simulationManager.AddAction(BulldozeBuilding(buildingId));
             _buildingObserver.BuildingsIds.Remove(buildingId);
         }
     }
 }
Example #2
0
        private void checkBuildings(ushort[] buildings)
        {
            foreach (ushort toBulldoze in buildings)
            {
                if (c2++ > V10Bulldoze.ui.data.max)
                {
                    break;
                }

                simulationManager.AddAction((IEnumerator)method.Invoke(bulldozeTool, new object[] { toBulldoze }));
                SkylinesOverwatch.Helper.Instance.RequestBuildingRemoval(toBulldoze);
            }
        }
Example #3
0
        public static void EmptyBuildings(List <ushort> list, bool emptying)
        {
            try
            {
                SimulationManager simulationManager = Singleton <SimulationManager> .instance;

                foreach (ushort buildingId in list)
                {
                    simulationManager.AddAction(EmptyBuilding(buildingId, emptying));
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Empty It!] EmptyUtils:EmptyBuildings -> Exception: " + e.Message);
            }
        }
Example #4
0
        public static void DeleteBuildings(List <ushort> list)
        {
            try
            {
                SimulationManager simulationManager = Singleton <SimulationManager> .instance;

                foreach (ushort buildingId in list)
                {
                    simulationManager.AddAction(DeleteBuilding(buildingId));
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Bulldoze It!] BulldozeUtils:DeleteBuildings -> Exception: " + e.Message);
            }
        }
        public void DemolishSegmentGroup(NetInfoGroupViewReadModel netInfoGroupViewReadModel)
        {
            _simulationManager.AddAction(() =>
            {
                foreach (var netInfoReplacementModel in netInfoGroupViewReadModel.NetInfoReplacementModels)
                {
                    DemolishNetSegments(netInfoReplacementModel.SystemNameOriginal);
                }

                _coverageManager.CoverageUpdated(ItemClass.Service.None, ItemClass.SubService.None, ItemClass.Level.None);
                _netManager.m_nodesUpdated = true;
            });

            Debug.Log($"Demolish of {netInfoGroupViewReadModel.DisplayNameOriginal} completed.");
        }
        public static void PurchaseAll()
        {
            try
            {
                SimulationManager simulationManager = Singleton <SimulationManager> .instance;

                if (simulationManager != null)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        for (int j = 0; j < 5; j++)
                        {
                            simulationManager.AddAction(Purchase(i, j));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Rebuild It!] PurchaseUtils:PurchaseAll -> Exception: " + e.Message);
            }
        }