namespace AoC24.Common; using AoCLevelInputProvider; using Parsing; using Parsing.Schema; using Parsing.Tokenization; public abstract class LevelSolverBase { public abstract int LevelNumber { get; } private int Year = 2024; private LevelInputProvider inputProvider = new LevelInputProvider(); protected string GetLevelInput() { return inputProvider.WithYear(this.Year).WithLevel(this.LevelNumber).Provide(); } public abstract string SolveFirstStar(); public abstract string SolveSecondStar(); protected abstract InputSchemaBuilder DefineInputSchema(InputSchemaBuilder schemaBuilder); public TokenConverter GetData() { var schemaBuilder = new InputSchemaBuilder(); var schema = this.DefineInputSchema(schemaBuilder).Build(); var parser = new TextParser(schema); var data = parser .SetInputText(this.GetLevelInput()) .Parse(); return data; } }