public override void Draw(DrawSpace ds) { // border ds.Color = IsActive ? ActiveBorderColor : InactiveBorderColor; // Characters: ┌ ┐ ┘ └ ─ │ ─ │ ┬ ┤ ┴ ├ ┼ ds.DrawBorder(new Rectangle(0,0,5,4), "┌┬┼├─│─│"); ds.DrawBorder(new Rectangle(8,0,5,4), "┬┐┤┼─│─│"); ds.DrawBorder(new Rectangle(8,6,5,4), "┼┤┘┴─│─│"); ds.DrawBorder(new Rectangle(0,6,5,4), "├┼┴└─│─│"); ds.DrawLine(new Point(4+1,0), new Point(8-1,0), '─'); ds.DrawLine(new Point(4+1,3), new Point(8-1,3), '─'); ds.DrawLine(new Point(4+1,6), new Point(8-1,6), '─'); ds.DrawLine(new Point(4+1,9), new Point(8-1,9), '─'); ds.DrawLine(new Point(0,3+1), new Point(0,6-1), '│'); ds.DrawLine(new Point(4,3+1), new Point(4,6-1), '│'); ds.DrawLine(new Point(8,3+1), new Point(8,6-1), '│'); ds.DrawLine(new Point(12,3+1), new Point(12,6-1), '│'); // noughts & crosses for(int i = 0; i < 3; ++i) for(int j = 0; j < 3; ++j) { var pos = new Point(1+4*i, 1+3*j); switch (field[i,j]) { case Cell.Empty: ds.Color = IsActive ? ActiveEmptyColor : InactiveEmptyColor; break; case Cell.Cross: ds.Color = IsActive ? ActiveCrossColor : InactiveCrossColor; break; case Cell.Nought: ds.Color = IsActive ? ActiveNoughtColor : InactiveNoughtColor; break; default: break; } var ch = (currentPoint == new Point(i,j)) ? '░' : ' '; ds.DrawLine(pos + new Size(0,0), pos + new Size(2,0), ch); ds.DrawLine(pos + new Size(0,1), pos + new Size(2,1), ch); } }
public abstract void Draw(DrawSpace ds);