update runner to set date
This commit is contained in:
@@ -37,6 +37,24 @@ public class AOCRunner
|
||||
}
|
||||
}
|
||||
|
||||
public AOCRunner WithDay(int day)
|
||||
{
|
||||
var problem = _loadedProblems[_selectedYear].FirstOrDefault(d => d.info.Day == day);
|
||||
if (problem == default)
|
||||
throw new ArgumentException($"The no problems have been loaded for the day '{day}' of year '{_selectedYear}'", nameof(day));
|
||||
|
||||
_selectedDay = _loadedProblems[_selectedYear].IndexOf(problem);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AOCRunner WithYear(int year)
|
||||
{
|
||||
if (!_loadedProblems.ContainsKey(year))
|
||||
throw new ArgumentException($"The no problems have been loaded for the year '{year}'", nameof(year));
|
||||
_selectedYear = year;
|
||||
return this;
|
||||
}
|
||||
|
||||
private void InitSizing()
|
||||
{
|
||||
_maxProblemCount = Console.WindowHeight - 9;
|
||||
|
||||
Reference in New Issue
Block a user