Пример #1
0
        public Knight Move(Coordinates newCoordinates)
        {
            if (!AvailableMoves.Contains(newCoordinates))
            {
                throw new InvalidMoveException();
            }

            return(new Knight(newCoordinates, _chessboard, _movementTracker));
        }
Пример #2
0
        public Rook Move(Coordinates newCoordinates)
        {
            if (AvailableMoves.Contains(newCoordinates))
            {
                return(new Rook(newCoordinates, _chessboard));
            }

            throw new InvalidMoveException();
        }
Пример #3
0
        public KnightV2 Move(Coordinates newCoordinates)
        {
            if (!AvailableMoves.Contains(newCoordinates))
            {
                throw new InvalidMoveException();
            }

            if (_isStartPosition)
            {
                PublishMovement(Location);
            }

            return(new KnightV2(newCoordinates, _chessboard, _observers));
        }