19 lines
591 B
C#
19 lines
591 B
C#
namespace ParadoxSaveParser.Lib;
|
|
|
|
/// <summary>"[7]" — matches the node at one position.</summary>
|
|
internal sealed class IndexMatchExpression(int index, ISearchExpression? next) : ISearchExpression
|
|
{
|
|
public bool DoesMatch(MatchCandidate candidate, out ISearchExpression? nextSearchExpression)
|
|
{
|
|
if (candidate.Index == index)
|
|
{
|
|
nextSearchExpression = next;
|
|
return true;
|
|
}
|
|
|
|
nextSearchExpression = null;
|
|
return false;
|
|
}
|
|
|
|
public void ReEncode(Encoding encoding) => next?.ReEncode(encoding);
|
|
} |