62cbb4b16a
Sealed Objective types (clearGems/reachScore/clearLines) with JSON round-trip; StageConfig with preset cells and star thresholds; GameEngine orchestrating placement -> clear -> scoring -> objectives with stuck detection, one-shot rescue (continue / +5 moves), and deterministic per-attempt RNG. 100-game headless stress test and pure-Dart architecture guard. 76 tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
29 lines
617 B
Dart
29 lines
617 B
Dart
import '../models/piece.dart';
|
|
|
|
/// Events emitted by the engine during a placement, consumed by objectives
|
|
/// and (later) the UI effects layer.
|
|
sealed class GameEvent {
|
|
const GameEvent();
|
|
}
|
|
|
|
class PiecePlaced extends GameEvent {
|
|
const PiecePlaced({required this.piece, required this.x, required this.y});
|
|
|
|
final Piece piece;
|
|
final int x;
|
|
final int y;
|
|
}
|
|
|
|
class LinesCleared extends GameEvent {
|
|
const LinesCleared({required this.lines, required this.gems});
|
|
|
|
final int lines;
|
|
final int gems;
|
|
}
|
|
|
|
class ScoreChanged extends GameEvent {
|
|
const ScoreChanged({required this.total});
|
|
|
|
final int total;
|
|
}
|