Пример #1
0
        public void SubGridChanges(bool clean = false, bool dupCheck = false)
        {
            foreach (var grid in AddSubGrids)
            {
                if (grid == MyGrid)
                {
                    continue;
                }
                RegisterSubGrid(grid, dupCheck);
            }
            AddSubGrids.Clear();

            foreach (var grid in RemSubGrids)
            {
                if (grid == MyGrid)
                {
                    continue;
                }
                UnRegisterSubGrid(grid);
            }
            RemSubGrids.Clear();

            if (!clean)
            {
                UpdateRoot();
            }
        }
Пример #2
0
        public void CleanSubGrids()
        {
            foreach (var grid in SubGrids)
            {
                if (grid == MyGrid)
                {
                    continue;
                }
                UnRegisterSubGrid(grid, true);
            }

            SubGrids.Clear();
            RemSubGrids.Clear();
            AddSubGrids.Clear();
            TmpSubGrids.Clear();
            SubGridsChanged = false;
        }
Пример #3
0
        public void SubGridChanges()
        {
            foreach (var grid in AddSubGrids)
            {
                if (grid == MyGrid)
                {
                    continue;
                }

                grid.OnFatBlockAdded   += FatBlockAdded;
                grid.OnFatBlockRemoved += FatBlockRemoved;

                FatMap fatMap;
                if (Session.GridToFatMap.TryGetValue(grid, out fatMap))
                {
                    var blocks = fatMap.MyCubeBocks;
                    for (int i = 0; i < blocks.Count; i++)
                    {
                        FatBlockAdded(blocks[i]);
                    }
                }
            }
            AddSubGrids.Clear();

            foreach (var grid in RemSubGrids)
            {
                if (grid == MyGrid)
                {
                    continue;
                }
                SubGrids.Remove(grid);
                grid.OnFatBlockAdded   -= FatBlockAdded;
                grid.OnFatBlockRemoved -= FatBlockRemoved;
            }
            RemSubGrids.Clear();

            UpdateConstruct();
        }