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
DemoBootstrapHostchild node must be present in the scene tree before _Ready() runs — see the shared demo bootstrap scenes underdemos/shared/bootstrap/for the reference wiring.Demo projects (this repo): The ECS-specific partial
demos/shared/bootstrap/GridPlacementBootstrap.EcsInit.csimplements 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
DemoBootstrapHostpattern lets demo/test scenes bring their own initialization without polluting the addon boundary.Adding to a new scene
- Add
GridPlacementBootstrapas a node. - Add a
DemoBootstrapHostas a child node. - Assign the same Context to both nodes.
- See
demos/shared/bootstrap/ordocs/quick-start.mdfor the full reference scene hierarchy.
- Add
- 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.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
- Create:
new PlacementContext() - Configure: set
Settingsproperty if needed - Initialize: call
Initialize(EntityStore)with an ECS store - Use: access services directly via ManipulationSystem, ExecutionSystem, PreviewSystem, etc.
- 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.
- Create:
- 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
- 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
- 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.