GridSyncOptimizer
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.
Declaration
Summary
Optimizes synchronization between logical ECS grid state and visual TileMapLayer.
This class implements three proven optimization strategies from Thistletide:
- Hash-based early exit - Skip sync if nothing changed
- Dirty chunk updates - Only sync changed chunks
- Neighborhood expansion - Mark neighbors dirty for correctness
These optimizations provide 5-10× speedup for typical placement operations.
Metadata
Namespace: GridPlacement.Godot.Addons.GridPlacement.Infrastructure
Source File: cs/Godot/addons/GridPlacement/Infrastructure/GridSyncOptimizer.cs
Assembly: GridPlacement.Godot
Type: class
Constructors
GridSyncOptimizer
Initializes a new instance of the GridSyncOptimizer.
Parameters
| Name | Description |
|---|---|
chunkSize | Size of chunks for dirty updates (default: 16). |
Methods
HasOccupancyChanged
Checks if the occupancy state has changed since the last sync.
Parameters
| Name | Description |
|---|---|
occupiedCells | Current set of occupied cells. |
Returns
True if the state has changed, false otherwise.
SyncToTileMapLayer
Synchronizes the logical grid state to the visual TileMapLayer using optimized strategies.
Parameters
| Name | Description |
|---|---|
occupiedCells | Current set of occupied cells. |
tileMapLayer | Target TileMapLayer to update. |
Returns
True if sync was performed, false if early exit (no changes).
Reset
Resets the optimizer’s internal state. Use this when the grid state is completely replaced (not updated incrementally).