示例#1
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            //once the game is finished stop responding to mouse clicks
            if (_gameFinished)
            {
                return;
            }

            //make sure we have an iteractive player. If they are not
            //we are not going to respond user events.
            if (!_currentPlayer.IsInteractive())
            {
                return;
            }

            //Find which column we've clicked on so we can tell the game controller
            //to drop a tile on it.
            _uiBoardColumns.ForEach(uiColumn => {
                if (uiColumn.ContainsPoint(e.Location))
                {
                    _currentGame.DropTokenOnColumn(uiColumn);
                }
            });
        }