Class TileMapSyncManager
- Namespace
- MoonBark.GridPlacement.Godot.Placement
- Assembly
- MoonBark.GridPlacement.Godot.dll
Manages synchronization between ECS grid occupancy state and Godot TileMapLayer.
Uses GridSyncOptimizer for change detection and batching, and resolves tile source data (TileTypeId → Godot tile coords) via IGridOccupancy for each dirty cell.
Attach to a node that has access to PlacementContext and LevelContext.
public class TileMapSyncManager
- Inheritance
-
TileMapSyncManager
- Inherited Members
Constructors
TileMapSyncManager(PlacementContext, int)
Creates a new TileMapSyncManager.
public TileMapSyncManager(PlacementContext context, int chunkSize = 16)
Parameters
contextPlacementContextThe placement context providing ECS grid state.
chunkSizeintChunk size for sync batching. Default is 16.
Properties
Context
The placement context providing access to ECS grid state.
public PlacementContext Context { get; }
Property Value
Optimizer
The grid sync optimizer for change detection.
public GridSyncOptimizer Optimizer { get; }
Property Value
Methods
ResolveTileMapLayer()
Resolves the TileMapLayer from LevelContext.
public TileMapLayer? ResolveTileMapLayer()
Returns
- TileMapLayer
The resolved TileMapLayer, or null if not available.
SyncIfNeeded()
Synchronizes ECS grid occupancy to TileMapLayer if needed. Uses GridSyncOptimizer to detect changes and batch updates.
public bool SyncIfNeeded()
Returns
- bool
True if a sync was performed; false if no changes were detected.