コード例 #1
0
ファイル: FormMainWindow.cs プロジェクト: marcinkow/c_hasz
 private void refreshView()
 {
     foreach (Button b in panelButtons.Controls)
     {
         //pobieram z gry pole powiązane z danym buttonem
         SaperLogic.Field f = myGame.GetFiled((Point)b.Tag);
         if (f.Covered == false)
         {
             if (f.FieldType == SaperLogic.FieldTypeEnum.Bomb)
             {
                 b.BackColor = Color.Red;
                 b.Text      = "@";
             }
             else
             {
                 //dla obu rodzadjów pól
                 b.BackColor = Color.White;
                 //tylko dla pól z cyframi
                 if (f.FieldType == SaperLogic.FieldTypeEnum.BombCount)
                 {
                     b.Text = f.BombCount.ToString();
                 }
             }
         }
     }
 }