Guest User

Untitled

a guest
Oct 13th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1.     public partial class Form1 : Form
  2.     {
  3.         public Form1()
  4.         {
  5.             InitializeComponent();
  6.             Graphics g = panel1.CreateGraphics();
  7.             Field field = new Field(g);
  8.             field.DrawField();
  9.         }
  10.     }
  11.  
  12.     class Field
  13.     {
  14.         private char[,] Cells;
  15.         Graphics g;
  16.  
  17.         public Field(g)
  18.         {
  19.          this.g = g;
  20.              //...
  21.         }
  22.  
  23.         public void DrawField()
  24.         {
  25.             for (int row = 0; row < 6; row++) {
  26.                 for (int col = 0; col < 7; col++) {
  27.                     this.DrawCell(Cells[row, col], row, col);
  28.                 }
  29.             }
  30.         }
  31.  
  32.         private void DrawCell(char cell, int row, int col)
  33.         {
  34.             g.FillRectangle(Brushes.White, x, y, cellWidth, cellHeight);
  35.         //...
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment