/// <summary> /// Bindings for the dependencies from the ProblemGenerator module. /// </summary> /// <param name="kernel">The kernel.</param> /// <param name="settings">The settings for <see cref="ProblemGenerator"/>.</param> /// <returns>The kernel for chaining.</returns> public static IKernel AddProblemGenerator(this IKernel kernel, ProblemGeneratorSettings settings) { // Bind the generator kernel.Bind <IProblemGenerator>().To <ProblemGenerator>().WithConstructorArgument(settings); // Bind the tracer kernel.Bind <IGeometryFailureTracer>().To <EmptyGeometryFailureTracer>(); // Return the kernel for chaining return(kernel); }
/// <summary> /// Initializes a new instance of the <see cref="ProblemGenerator"/> class. /// </summary> /// <param name="settings">The settings for the problem generator.</param> /// <param name="generator">The generator of configurations.</param> /// <param name="constructor">The constructor that perform geometric construction of configurations.</param> /// <param name="finder">The finder of theorems in generated configurations.</param> /// <param name="tracer">The tracer of potential geometry failures.</param> public ProblemGenerator(ProblemGeneratorSettings settings, IConfigurationGenerator generator, IGeometryConstructor constructor, ITheoremFinder finder, IGeometryFailureTracer tracer) { _settings = settings ?? throw new ArgumentNullException(nameof(settings)); _generator = generator ?? throw new ArgumentNullException(nameof(generator)); _constructor = constructor ?? throw new ArgumentNullException(nameof(constructor)); _finder = finder ?? throw new ArgumentNullException(nameof(finder)); _tracer = tracer ?? throw new ArgumentNullException(nameof(tracer)); }