Example #1
0
        public void TryPlaceFlag(Graphics g)
        {
            switch (this.State)
            {
            case CellState.Covered:
                FlagSuccesfullyPlaced?.Invoke(this, EventArgs.Empty);
                this.State = CellState.Flag;
                this.Draw(g);
                break;

            case CellState.Flag:
                this.State = CellState.Covered;
                FlagDeleted?.Invoke(this, EventArgs.Empty);
                this.Draw(g);
                break;

            default:
                break;
            }
        }
 private void Board_FlagDeleted(object sender, EventArgs e)
 {
     FlagDeleted?.Invoke(this, EventArgs.Empty);
 }