feat(03-02): add clearTiles method to GridManager

- Added clearTiles method that marks tiles as cleared
- Emits tile:cleared event for each cleared tile
- Calls deselectAll() after clearing tiles
- Enables CORE-05 (connected tiles disappear) and CORE-07 (cleared tiles become passable)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Sonnet
2026-03-11 04:40:30 +00:00
parent 0bf9910a2c
commit b2fec2ec29
+14
View File
@@ -109,6 +109,20 @@ export class GridManager {
return this.tiles;
}
/**
* Clear tiles (mark as cleared and emit events)
* @param tiles - Array of tiles to clear
*/
clearTiles(tiles: Tile[]): void {
tiles.forEach(tile => {
tile.cleared = true;
this.events.emit('tile:cleared', { tile });
});
// Clear selection after clearing tiles
this.deselectAll();
}
/**
* Get the event emitter for external subscription
*/