IsValidCell() public method

Tests if a cell is valid based on its index.
public IsValidCell ( int index ) : bool
index int The index to test.
return bool
示例#1
0
        public void Draw(SurfaceEditor surface)
        {
            if (BorderAppearance == null)
                BorderAppearance = new CellAppearance(Color.Blue, Color.Black, 4);

            Algorithms.Circle(Center.X, Center.Y, Radius, (x, y) => { if (surface.IsValidCell(x, y)) surface.SetCellAppearance(x, y, BorderAppearance); });
        }
示例#2
0
 //public ICellAppearance FillAppearance;
 //public bool Fill;
 public void Draw(SurfaceEditor surface)
 {
     Algorithms.Ellipse(StartingPoint.X, StartingPoint.Y, EndingPoint.X, EndingPoint.Y, (x, y) => { if (surface.IsValidCell(x, y)) surface.SetCellAppearance(x, y, BorderAppearance); });
 }
示例#3
0
文件: Box.cs 项目: Thraka/SadConsole
        private void PlotCell(SurfaceEditor surface, int x, int y, int glyph, bool fillMe = false)
        {
            if (surface.IsValidCell(x,y))
            {
                var cell = surface[x, y];

                if (fillMe)
                {
                    cell.Background = FillColor;
                    cell.Foreground = Foreground;
                    cell.GlyphIndex = glyph;
                    return;
                }

                if (Foreground != Color.Transparent || DrawTransparency)
                    cell.Foreground = Foreground;

                if (BorderBackground != Color.Transparent || DrawTransparency)
                    cell.Background = BorderBackground;

                cell.GlyphIndex = glyph;
            }
        }