12 lines
459 B
C#
12 lines
459 B
C#
namespace Beam {
|
|
internal interface IDocumentSourceLinkFactory {
|
|
SourceLink GetNextLink(SourceLink current);
|
|
SourceLink GetPrecedingLink(SourceLink current);
|
|
SourceLink GetArbitraryLink(SourceLink current, int offset) => offset switch {
|
|
0 => current,
|
|
> 0 => GetArbitraryLink(GetNextLink(current), offset - 1),
|
|
< 0 => GetArbitraryLink(GetPrecedingLink(current), offset + 1)
|
|
};
|
|
}
|
|
}
|