mirror of
https://github.com/tiennm99/gsd-framework.git
synced 2026-05-27 22:26:24 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user