Exemplo n.º 1
0
        private void PictureBox1_Click(object sender, EventArgs e)
        {
            if (grainTypeCombo.SelectedItem == null)
            {
                MessageBox.Show("Wybierz typ ziarna przed klikaniem na siatkę!");
                return;
            }
            int            grainType        = System.Convert.ToInt32(grainTypeCombo.SelectedItem);
            MouseEventArgs clicked          = (MouseEventArgs)e;
            Point          clickCoordinates = clicked.Location;

            simulation.AddSeedOfSpecifiedType(clickCoordinates.Y / cellSize, clickCoordinates.X / cellSize, grainType);
        }