feat(engine): line-bomb booster clears a row or column
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user