예제 #1
0
파일: MainForm.cs 프로젝트: debug8/Sapper
 public void SetElementStatus(int row, int column, FieldElementStatus status)
 {
     fieldControl.SetElementStatus(row, column, status);
 }
예제 #2
0
        public void SetElementStatus(int row, int column, FieldElementStatus status)
        {
            var element = Controls.OfType <FieldButton>().Where(b => b.Row == row && b.Column == column).First();

            element.SetStatus(status);
        }
예제 #3
0
        internal void SetStatus(FieldElementStatus status)
        {
            this.status = status;
            switch (status)
            {
            case FieldElementStatus.Open0:
                BackgroundImage = FieldButtonResources.buttonPressed;
                return;

            case FieldElementStatus.Open1:
                BackgroundImage = FieldButtonResources.buttonOpen1;
                return;

            case FieldElementStatus.Open2:
                BackgroundImage = FieldButtonResources.buttonOpen2;
                return;

            case FieldElementStatus.Open3:
                BackgroundImage = FieldButtonResources.buttonOpen3;
                return;

            case FieldElementStatus.Open4:
                BackgroundImage = FieldButtonResources.buttonOpen4;
                return;

            case FieldElementStatus.Open5:
                BackgroundImage = FieldButtonResources.buttonOpen5;
                return;

            case FieldElementStatus.Open6:
                BackgroundImage = FieldButtonResources.buttonOpen6;
                return;

            case FieldElementStatus.Open7:
                BackgroundImage = FieldButtonResources.buttonOpen7;
                return;

            case FieldElementStatus.Open8:
                BackgroundImage = FieldButtonResources.buttonOpen8;
                return;

            case FieldElementStatus.BombFlagged:
                BackgroundImage = FieldButtonResources.buttonFlagged;
                return;

            case FieldElementStatus.BombRevealed:
                BackgroundImage = FieldButtonResources.bombRevealed;
                return;

            case FieldElementStatus.BombDeath:
                BackgroundImage = FieldButtonResources.bombDeath;
                return;

            case FieldElementStatus.BombMisFlagged:
                BackgroundImage = FieldButtonResources.bombMisFlagged;
                return;

            case FieldElementStatus.Active:
                BackgroundImage = FieldButtonResources.buttonUnpressed;
                return;
            }
        }