Configuration vs. Settings
Understanding the distinction between Core Configurations and Godot Settings in GridPlacement 6.0
Overview
To achieve strict separation between the Pure Logic Core (6.0) and Engine Adapters (Godot/Unity), distinguishes between Settings and Configuration.
| Layer | Type | Suffix | Description |
|---|---|---|---|
| Core (Logic) | C# POCO | Configuration | Pure data POCOs. Structural, immutable snapshots valid for a logic frame. |
| Engine (Adapter) | Godot Resource | Settings | Inspector-friendly assets (.tres). Used for configuration persistence. |
1. Core Layer: *Configuration
Located in GridPlacement.Core.Configuration, these are pure C# classes. They implement the IConfiguration marker interface and have zero dependencies on engine APIs.
| |
Benefits
- Deterministic Testing: Test logic in XUnit without loading Godot or Unity.
- Immutability: Components receive a snapshot, preventing accidental global state mutation during calculations.
- Portability: The same configuration schema works in any engine.
2. Engine Layer: *Settings
In Godot, settings are implemented as Resource objects. These provide the bridge between the Inspector and the Core logic.
The IConfigurationProvider Bridge
Engine-side objects implement the IConfigurationProvider<T> interface. This acts as a factory that converts mutable engine data into a pure logic snapshot.
| |
3. Dependency Injection Pattern
Core Services must never depend on Godot Resources. Instead, they inject the provider interface to maintain the engine boundary.
| |
4. Standard Logical Actions
Input mapping is handled by the InputConfiguration, which maps engine actions to system intents.
| Logical Action | Default Godot Mapping |
|---|---|
| Build Mode | build_mode |
| Confirm Build | build_confirm |
| Cancel / Off | build_cancel |
| Rotate Left | build_rotate_left |
| Flip Horizontal | build_flip_h |
Last updated: 2025-12-22