Class PlacementRuntimeCoordinator
- Namespace
- MoonBark.GridPlacement.Godot.Placement
- Assembly
- MoonBark.GridPlacement.Godot.dll
Runtime coordinator for the MoonBark.GridPlacement system. Orchestrates ECS systems, TileMap sync, and tile check rules.
Ownership
This class is created by DemoBootstrapHost (or GridPlacementBootstrap ECS partial) during scene initialization, NOT by the addon's GridPlacementBootstrap._EnterTree().
Update Loop
Update(float)is called every frame in the normal process loop.PhysicsUpdate(float)is called every physics frame.- Which one processes systems is controlled by
Settings.EnsureUpdateLoop().UpdateMode.
Initialization Order
- Constructor:
new PlacementRuntimeCoordinator(context) - Configuration:
SetRuntimeCatalog(catalog),RegisterTileCheckRule(rule) - Initialization:
Initialize(bootstrap)- wires to bootstrap signals - Update loop:
Update(delta)orPhysicsUpdate(delta)called each frame - Cleanup:
Cleanup()called when exiting the scene tree
public class PlacementRuntimeCoordinator
- Inheritance
-
PlacementRuntimeCoordinator
- Inherited Members
Constructors
PlacementRuntimeCoordinator(PlacementContext)
Creates a new PlacementRuntimeCoordinator.
public PlacementRuntimeCoordinator(PlacementContext context)
Parameters
contextPlacementContextThe placement context. Must not be null.
Exceptions
- ArgumentNullException
Thrown if context is null.
Properties
Context
The placement context providing ECS backend and services.
public PlacementContext Context { get; }
Property Value
SceneSyncManager
The scene sync manager for ECS-to-Godot node synchronization. Created during Initialize() and set on Context.SceneSyncManager.
public PlacementSceneAdapter? SceneSyncManager { get; }
Property Value
TileCheckExecutor
The tile check executor for placement validation. Null until Initialize() is called.
public TileCheckRuleExecutor? TileCheckExecutor { get; }
Property Value
Methods
Cleanup()
Cleans up all resources held by the coordinator. Safe to call multiple times.
public void Cleanup()
Initialize(GridPlacementBootstrap)
Initializes the coordinator with a bootstrap reference. Called after construction during scene setup.
public void Initialize(GridPlacementBootstrap bootstrap)
Parameters
bootstrapGridPlacementBootstrapThe GridPlacementBootstrap node.
PhysicsUpdate(float)
Updates the placement system. Called every physics frame from _PhysicsProcess. Only processes when UpdateMode is PhysicsProcess.
public void PhysicsUpdate(float delta)
Parameters
deltafloatTime elapsed since last physics frame in seconds.
RegisterTileCheckRule(TileCheckRule)
Registers a tile check rule for placement validation.
public void RegisterTileCheckRule(TileCheckRule rule)
Parameters
ruleTileCheckRuleThe tile check rule to register.
SetRuntimeCatalog(IPlaceableRuntimeCatalog)
Sets the runtime catalog for placeable lookups. Can be called before or after Initialize().
public void SetRuntimeCatalog(IPlaceableRuntimeCatalog catalog)
Parameters
catalogIPlaceableRuntimeCatalogThe runtime catalog.
Update(float)
Updates the placement system. Called every frame from _Process. Only processes when UpdateMode is Process.
public void Update(float delta)
Parameters
deltafloatTime elapsed since last frame in seconds.