Table of Contents

Namespace MoonBark.GridPlacement.Godot.Placement

Classes

GridPlacementBootstrap

Godot scene entry point that manages the placement system lifecycle.

Standalone vs Demo usage

Addon (standalone): This bootstrap is a thin shim. It owns lifecycle (enter/exit tree, cleanup) and emits the InitializedSignal but does NOT initialize the placement runtime by itself. For the runtime to work, a DemoBootstrapHost child node must be present in the scene tree before _Ready() runs — see the shared demo bootstrap scenes under demos/shared/bootstrap/ for the reference wiring.

Demo projects (this repo): The ECS-specific partial demos/shared/bootstrap/GridPlacementBootstrap.EcsInit.cs implements MoonBark.GridPlacement.Godot.Placement.GridPlacementBootstrap.OnPlacementContextInitialized() to wire the Friflo.Engine.ECS backend after the Context is ready.

Why this design

The full bootstrap was removed during the ECS decoupling refactor so the addon remains engine-agnostic. The DemoBootstrapHost pattern lets demo/test scenes bring their own initialization without polluting the addon boundary.

Adding to a new scene

  1. Add GridPlacementBootstrap as a node.
  2. Add a DemoBootstrapHost as a child node.
  3. Assign the same Context to both nodes.
  4. See demos/shared/bootstrap/ or docs/quick-start.md for the full reference scene hierarchy.
GridPlacementBootstrap.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

GridPlacementBootstrap.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

GridPlacementBootstrap.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

HotbarInputSettings
HotbarInputSettings.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

HotbarInputSettings.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

HotbarInputSettings.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

PlacementContext

Main context for the MoonBark.GridPlacement system in Godot. Owns ECS systems, grid occupancy, and placement services.

Lifecycle

  1. Create: new PlacementContext()
  2. Configure: set Settings property if needed
  3. Initialize: call Initialize(EntityStore) with an ECS store
  4. Use: access services directly via ManipulationSystem, ExecutionSystem, PreviewSystem, etc.
  5. Cleanup: call DisposePlacementContext()

Design Notes

PlacementContext is a Godot Resource so it can be:

  • Created via object initializer: new PlacementContext { Settings = mySettings }
  • Saved as a .tres file for editor configuration
  • Shared across nodes via resource reference

ECS systems are accessed directly (no adapter layer). This is the primary API.

PlacementContext.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

PlacementContext.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

PlacementContext.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

PlacementRuntimeCoordinator

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
PlacementSceneAdapter
PlacementSettings

Root settings resource for the MoonBark.GridPlacement system. Contains all configurable options for the placement runtime.

Attach to a GridPlacementBootstrap node via the Settings property or create as a standalone .tres resource.

Example usage in code: var settings = new PlacementSettings(); settings.EnsureUpdateLoop().UpdateMode = GridPlacementBootstrapUpdateMode.PhysicsProcess; context.Settings = settings;

PlacementSettings.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

PlacementSettings.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

PlacementSettings.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

PlacementUpdateLoopSettings

Configuration for the placement update loop behavior. Controls whether placement logic runs in the normal frame loop or physics loop.

PlacementUpdateLoopSettings.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

PlacementUpdateLoopSettings.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

PlacementUpdateLoopSettings.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

TileMapSyncManager

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.

TileMapSyncSettings

Settings for TileMap synchronization behavior.

TileMapSyncSettings.MethodName

Cached StringNames for the methods contained in this class, for fast lookup.

TileMapSyncSettings.PropertyName

Cached StringNames for the properties and fields contained in this class, for fast lookup.

TileMapSyncSettings.SignalName

Cached StringNames for the signals contained in this class, for fast lookup.

Enums

GridPlacementBootstrapUpdateMode

Settings for controlling placement system update loop behavior. Determines whether placement logic runs in _Process or _PhysicsProcess.

Delegates

GridPlacementBootstrap.InitializedSignalEventHandler

Signal emitted when the bootstrap has finished initializing, for GDScript compatibility.