Ejemplo n.º 1
0
        protected override void VisualizeCells(ICollection <VisCellData> newCells)
        {
            int baseCell = Grid.PosToCell(gameObject), width = Grid.WidthInCells;

            if (Grid.IsValidCell(baseCell))
            {
                Grid.CellToXY(baseCell, out int startX, out int startY);
                // Base game adds 3 (height) and subtracts 3
                for (int x = -scanRadius; x <= scanRadius; x++)
                {
                    // Up to height limit
                    for (int y = startY; y < Grid.HeightInCells; y++)
                    {
                        int newX = startX + x - 1, cell = Grid.XYToCell(newX, y);
                        if (Grid.IsValidCell(cell) && newX >= 0 && newX <= width)
                        {
                            newCells.Add(new VisCellData(cell, SpaceScannerVisualizer.
                                                         IsSunBlocked(cell) ? BLOCKED_TINT : Color.white));
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void VisualizeCells(ICollection <VisCellData> newCells)
        {
            int baseCell = Grid.PosToCell(gameObject);

            if (Grid.IsValidCell(baseCell))
            {
                Grid.CellToXY(baseCell, out int startX, out int startY);
                // Currently telescopes cannot be rotated in game
                for (int x = -scanRadius; x <= scanRadius; x++)
                {
                    // Up to height limit
                    for (int y = startY + 4; y < Grid.HeightInCells; y++)
                    {
                        int cell = Grid.XYToCell(startX + x - 1, y);
                        if (Grid.IsValidCell(cell))
                        {
                            newCells.Add(new VisCellData(cell, SpaceScannerVisualizer.
                                                         IsSunBlocked(cell) ? BLOCKED_TINT : Color.white));
                        }
                    }
                }
            }
        }