Exemplo n.º 1
0
        private void CalculateRoofsAboutToCollapse(CellRect rect)
        {
            Map map = BaseGen.globalSettings.map;

            roofsAboutToCollapse.Clear();
            visited.Clear();
            CellRect.CellRectIterator iterator = rect.GetIterator();
            while (!iterator.Done())
            {
                IntVec3 current = iterator.Current;
                if (current.Roofed(map) && !RoofCollapseCellsFinder.ConnectsToRoofHolder(current, map, visited))
                {
                    map.floodFiller.FloodFill(current, (IntVec3 x) => x.Roofed(map), delegate(IntVec3 x)
                    {
                        roofsAboutToCollapse.Add(x);
                    });
                }
                iterator.MoveNext();
            }
            CellRect.CellRectIterator iterator2 = rect.GetIterator();
            while (!iterator2.Done())
            {
                IntVec3 current2 = iterator2.Current;
                if (current2.Roofed(map) && !roofsAboutToCollapse.Contains(current2) && !RoofCollapseUtility.WithinRangeOfRoofHolder(current2, map))
                {
                    roofsAboutToCollapse.Add(current2);
                }
                iterator2.MoveNext();
            }
        }
        private void CalculateRoofsAboutToCollapse(CellRect rect)
        {
            Map map = BaseGen.globalSettings.map;

            SymbolResolver_EnsureCanHoldRoof.roofsAboutToCollapse.Clear();
            SymbolResolver_EnsureCanHoldRoof.visited.Clear();
            CellRect.CellRectIterator iterator = rect.GetIterator();
            while (!iterator.Done())
            {
                IntVec3 current = iterator.Current;
                if (current.Roofed(map))
                {
                    if (!RoofCollapseCellsFinder.ConnectsToRoofHolder(current, map, SymbolResolver_EnsureCanHoldRoof.visited))
                    {
                        map.floodFiller.FloodFill(current, (IntVec3 x) => x.Roofed(map), delegate(IntVec3 x)
                        {
                            SymbolResolver_EnsureCanHoldRoof.roofsAboutToCollapse.Add(x);
                        }, 2147483647, false, null);
                    }
                }
                iterator.MoveNext();
            }
            CellRect.CellRectIterator iterator2 = rect.GetIterator();
            while (!iterator2.Done())
            {
                IntVec3 current2 = iterator2.Current;
                if (current2.Roofed(map))
                {
                    if (!SymbolResolver_EnsureCanHoldRoof.roofsAboutToCollapse.Contains(current2))
                    {
                        if (!RoofCollapseUtility.WithinRangeOfRoofHolder(current2, map, false))
                        {
                            SymbolResolver_EnsureCanHoldRoof.roofsAboutToCollapse.Add(current2);
                        }
                    }
                }
                iterator2.MoveNext();
            }
        }
Exemplo n.º 3
0
        private void CalculateRoofsAboutToCollapse(CellRect rect)
        {
            Map map = BaseGen.globalSettings.map;

            roofsAboutToCollapse.Clear();
            visited.Clear();
            foreach (IntVec3 item in rect)
            {
                if (item.Roofed(map) && !RoofCollapseCellsFinder.ConnectsToRoofHolder(item, map, visited))
                {
                    map.floodFiller.FloodFill(item, (IntVec3 x) => x.Roofed(map), delegate(IntVec3 x)
                    {
                        roofsAboutToCollapse.Add(x);
                    });
                }
            }
            foreach (IntVec3 item2 in rect)
            {
                if (item2.Roofed(map) && !roofsAboutToCollapse.Contains(item2) && !RoofCollapseUtility.WithinRangeOfRoofHolder(item2, map))
                {
                    roofsAboutToCollapse.Add(item2);
                }
            }
        }