示例#1
0
        private void OnBoardClick(object sender, BoardCellClickEventErgs e)
        {
            if (PastShots.ContainsKey(new Point(e.X, e.Y)))
            {
                return;
            }

            ShotTargetChosen(e.X, e.Y);
        }
示例#2
0
        private void OnCellClick(object sender, EventArgs e)
        {
            if (Mode != BoardMode.Game)
            {
                return;
            }

            var handler = OnClick;

            if (handler == null)
            {
                return;
            }

            var cell      = (BoardCell)sender;
            var eventArgs = new BoardCellClickEventErgs(cell.X, cell.Y);

            handler(this, eventArgs);
        }