Exemplo n.º 1
0
        internal void OnChessboardClicked(int x, int y)
        {
            if (_battleField == null)
            {
                return;
            }

            if (_battleField.GamePhase.CurrentPhase != GamePhase.Phase.WaitingForMove)
            {
                return;
            }

            if (x % 60 < 5 || x % 60 > 45 || y % 60 < 5 || y % 60 > 45)
            {
                return;
            }

            var from = _battleField.CurrentActivatedToken.Coordinate;
            var to   = _battleField.ConvertPictureboxPointToCoordinate(x, y);

            _battleField.MoveToken(from, to);
            NotifyTokenMoved(new MoveInfo(from, to));
        }