Implement parts of linear search and add more test cases for bisect

This commit is contained in:
2025-03-16 23:14:12 +01:00
parent 70198ff293
commit dbfe627877
2 changed files with 126 additions and 3 deletions

View File

@@ -48,11 +48,28 @@ class ModListTroubleshooter {
return currentModList;
}
ModList linearForward() {
ModList linearForward({int stepSize = 20}) {
_endIndex = _startIndex + stepSize;
final subset = originalModList.activeMods.keys.toList().sublist(
_startIndex,
_endIndex,
);
currentModList.disableAll();
currentModList.enableMods(subset);
_startIndex = _endIndex;
return currentModList;
}
ModList linearBackward() {
ModList linearBackward({int stepSize = 20}) {
_startIndex = _endIndex - stepSize;
_endIndex = _startIndex;
final subset = originalModList.activeMods.keys.toList().sublist(
_startIndex,
_endIndex,
);
currentModList.disableAll();
currentModList.enableMods(subset);
_endIndex = _startIndex;
return currentModList;
}