public Knight Move(Coordinates newCoordinates) { if (!AvailableMoves.Contains(newCoordinates)) { throw new InvalidMoveException(); } return(new Knight(newCoordinates, _chessboard, _movementTracker)); }
public Rook Move(Coordinates newCoordinates) { if (AvailableMoves.Contains(newCoordinates)) { return(new Rook(newCoordinates, _chessboard)); } throw new InvalidMoveException(); }
public KnightV2 Move(Coordinates newCoordinates) { if (!AvailableMoves.Contains(newCoordinates)) { throw new InvalidMoveException(); } if (_isStartPosition) { PublishMovement(Location); } return(new KnightV2(newCoordinates, _chessboard, _observers)); }