feat(engine): line-bomb booster clears a row or column

This commit is contained in:
2026-06-18 12:05:14 +09:00
parent bbf8cf3f08
commit e7cd079a5d
2 changed files with 49 additions and 0 deletions
+14
View File
@@ -236,4 +236,18 @@ class GameEngine {
_checkStuck();
return true;
}
/// Booster: empties one row or one column (exactly one of [row]/[col]).
/// No move/score/objective effect. Re-checks stuck.
bool useLineBomb({int? row, int? col}) {
if (_phase == GamePhase.won || _phase == GamePhase.lost) return false;
if ((row == null) == (col == null)) return false; // need exactly one
for (var i = 0; i < GridState.size; i++) {
final x = col ?? i;
final y = row ?? i;
_grid = _grid.withCell(x, y, const Cell(CellType.empty));
}
_checkStuck();
return true;
}
}