Add pure-Dart engine core: RNG, grid, placement, line clear, scoring, piece generator

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>
This commit is contained in:
2026-06-11 13:05:55 +09:00
parent 40528238b2
commit 0210c14858
19 changed files with 1408 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
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)';
}