Skip to content

Commit

Permalink
Implement IPuzzleGenerator for technique-based generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
SunnieShine authored and SunnieShine committed Mar 27, 2024
1 parent d314254 commit df0926e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Sudoku.Algorithm.Generating.TechniqueBased;
/// <summary>
/// Represents a generator type that generates puzzles, relating to a kind of technique.
/// </summary>
public abstract class TechniqueBasedPuzzleGenerator : ICultureFormattable
public abstract class TechniqueBasedPuzzleGenerator : ICultureFormattable, IPuzzleGenerator
{
/// <summary>
/// Represents a seed array for cells that can be used in core methods.
Expand Down Expand Up @@ -64,4 +64,11 @@ public abstract class TechniqueBasedPuzzleGenerator : ICultureFormattable
/// <seealso cref="Grid.Undefined"/>
/// <seealso cref="GenerationResult.Success"/>
public abstract GenerationResult GenerateUnique(out Grid result, CancellationToken cancellationToken = default);

/// <inheritdoc/>
Grid IPuzzleGenerator.Generate(IProgress<GeneratorProgress>? progress, CancellationToken cancellationToken)
{
var generationResult = GenerateUnique(out var result, cancellationToken);
return generationResult != GenerationResult.Success ? Grid.Undefined : result;
}
}
3 changes: 3 additions & 0 deletions src/docxml/Sudoku.Analytics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
<seealso cref="F:Sudoku.Concepts.Grid.Undefined"/>
<seealso cref="F:Sudoku.Algorithm.Generating.TechniqueBased.GenerationResult.Success"/>
</member>
<member name="M:Sudoku.Algorithm.Generating.TechniqueBased.TechniqueBasedPuzzleGenerator.Sudoku#Algorithm#Generating#IPuzzleGenerator#Generate(System.IProgress{Sudoku.Algorithm.Generating.GeneratorProgress},System.Threading.CancellationToken)">
<inheritdoc/>
</member>
<member name="T:Sudoku.Analytics.AnalysisContext">
<summary>
Defines a context that is used by step searchers to check the details of the solving and analysis information.
Expand Down

0 comments on commit df0926e

Please sign in to comment.