This repository was archived by the owner on Jan 25, 2025. It is now read-only.
Scanner: Add option flag to expand variations#127
Open
mikeb26 wants to merge 3 commits intonotnil:masterfrom
Open
Scanner: Add option flag to expand variations#127mikeb26 wants to merge 3 commits intonotnil:masterfrom
mikeb26 wants to merge 3 commits intonotnil:masterfrom
Conversation
This commit is part of a series to add an optional ability to expand variations when utilizing Scanner to iterate over a .pgn file. This commit specifically introduces ScannerOpts to enable consumers of Scanner to specify different scanning behavior. The first intended use is ScannerOpts.ExpandVariations. Currently Scanner will strip out any variations that are present in a game defined within a .pgn file. This new option (non-default) when specified will instead allow Scanner consumers to specify that when iterating over a .pgn it should create a new instance of a chess game for every variation encountered. Additionally this commit refactors Scanner internals to deal with the fact that decoding a single game may return a plural number of Game instances rather than a singular. Code to actually actually make this plural will be in a followup commit. (cherry picked from commit 42e2e16)
This commit is part of a series to add an optional ability to expand variations when utilizing Scanner to iterate over a .pgn file. This commit specifically implements moveListSetWithComments() when expandVariations==true. Additionally it adds a unit test to verify Scanner behaves as expected when ExpandVariations==true. (cherry picked from commit 666f43f)
666f43f to
d48f73c
Compare
This commit just adds a new pgn test case that ensures the combination of a PGN with a specified starting position and the ExpandVariations scanner option interoprate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note this PR depends on prior PR: #125
This series of commits adds an optional ability to expand variations when utilizing Scanner to iterate over a .pgn file. This is done by introducing an optional ScannerOpts where consumers of Scanner can specify different scanning behavior, beginning with an ExpandVariations option. When ExpandVariations==true, rather than create a single Game instance when scanning over a single game in a .pgn file, Scanner will instead create 1 Game instance per variation.