Add mod list troubleshooter skeleton

This commit is contained in:
2025-03-16 22:14:58 +01:00
parent 2a7b3f8345
commit 4d2b676c8b
2 changed files with 110 additions and 2 deletions

View File

@@ -0,0 +1,42 @@
import 'dart:async';
import 'package:rimworld_modman/logger.dart';
import 'package:rimworld_modman/mod.dart';
import 'package:rimworld_modman/mod_list.dart';
/// A class that helps find the minimum set of mods that exhibit a bug.
///
/// Provides two main algorithms:
/// - Binary search / bisect: Divides mods into smaller subsets to find problematic ones quickly.
/// - Linear search / batching: Tests mods in small groups to systematically identify issues.
///
/// These approaches help RimWorld mod users identify which mods are causing problems
/// when many mods are installed.
class ModListTroubleshooter {
final ModList originalModList;
ModList currentModList;
ModListTroubleshooter(ModList modList)
: originalModList = modList,
currentModList = modList.copyWith();
ModList binaryForward() {
return currentModList;
}
ModList binaryBackward() {
return currentModList;
}
ModList linearForward() {
return currentModList;
}
ModList linearBackward() {
return currentModList;
}
void reset() {
currentModList = originalModList.copyWith();
}
}