Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     Painter = Graphics.FromHwnd(pictureBoxGameField.Handle);
     CurrentGeneration = new cCurrentGeneration();
     CurrentGeneration.Clear();
     PaintField();
 }
Exemplo n.º 2
0
 public void Set(cCurrentGeneration Array)
 {
     for (int i = 0; i < 10; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             Generation[j, i] = Array.Get(j, i);
         }
     }
 }
Exemplo n.º 3
0
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.OpenFileDialog Open = new OpenFileDialog();
            Open.ShowDialog();
            if (Open.FileName != "")
            {
                try
                {
                    BinaryFormatter binFormat = new BinaryFormatter();
                    using (Stream fStream = new FileStream(Open.FileName, FileMode.Open, FileAccess.Read, FileShare.None))
                    {
                        CurrentGeneration = (cCurrentGeneration)binFormat.Deserialize(fStream);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Выбран неправильный файл");
                }
            }

            PaintField();
        }
Exemplo n.º 4
0
 public cNextGeneration(cCurrentGeneration Current)
 {
     CurrentGeneration = Current;
     NewGeneration.Clear();
 }