0210c14858
PCG32 seeded RNG; immutable 8x8 GridState with occupancy bitmask; placement legality + anyPlacementExists; simultaneous row/col clears with single-count gem credit; combo scoring with one-move grace; weighted-bag generator with pity bias and depth-3 solvability nudge. All TDD, 51 tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
497 B
Dart
23 lines
497 B
Dart
enum CellType { empty, filled, gem }
|
|
|
|
class Cell {
|
|
const Cell(this.type, {this.colorId = 0});
|
|
|
|
final CellType type;
|
|
final int colorId;
|
|
|
|
static const empty = Cell(CellType.empty);
|
|
|
|
bool get isOccupied => type != CellType.empty;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
other is Cell && other.type == type && other.colorId == colorId;
|
|
|
|
@override
|
|
int get hashCode => Object.hash(type, colorId);
|
|
|
|
@override
|
|
String toString() => 'Cell(${type.name}, color: $colorId)';
|
|
}
|