Table of Contents

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

  1. Constructor: new PlacementRuntimeCoordinator(context)
  2. Configuration: SetRuntimeCatalog(catalog), RegisterTileCheckRule(rule)
  3. Initialization: Initialize(bootstrap) - wires to bootstrap signals
  4. Update loop: Update(delta) or PhysicsUpdate(delta) called each frame
  5. 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

context PlacementContext

The 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

PlacementContext

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

PlacementSceneAdapter

TileCheckExecutor

The tile check executor for placement validation. Null until Initialize() is called.

public TileCheckRuleExecutor? TileCheckExecutor { get; }

Property Value

TileCheckRuleExecutor

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

bootstrap GridPlacementBootstrap

The 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

delta float

Time elapsed since last physics frame in seconds.

RegisterTileCheckRule(TileCheckRule)

Registers a tile check rule for placement validation.

public void RegisterTileCheckRule(TileCheckRule rule)

Parameters

rule TileCheckRule

The 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

catalog IPlaceableRuntimeCatalog

The 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

delta float

Time elapsed since last frame in seconds.