Beispiel #1
0
 private void Map_MouseClick(object sender, MouseEventArgs e)
 {
     foreach (Control control in EntityType.Controls)
     {
         if (control is RadioButton)
         {
             if (((RadioButton)control).Checked)
             {
                 if (control.Tag.ToString() == "0")
                 {
                     _grid.SetPlayer(e.X, e.Y);
                 }
                 else if (control.Tag.ToString() == "1")
                 {
                     _grid.SetAI(e.X, e.Y);
                 }
                 else if (control.Tag.ToString() == "2")
                 {
                     _grid.SetBlock(e.X, e.Y);
                 }
                 else if (control.Tag.ToString() == "3")
                 {
                     _grid.ClearCell(e.X, e.Y);
                 }
             }
         }
     }
     Map.Invalidate();
 }