Namespace MoonBark.GridPlacement.Core.Types
Classes
- CollisionProcessorInput
Input data for collision processing operations
- CollisionProcessorOutput
Output data from collision processing operations
- ConfigurationFormatExtensions
Extension helpers for working with ConfigurationFormat values across the runtime codebase.
- ConfigurationValidationResult
Result of configuration validation
- DiagnosticMessage
Strongly-typed diagnostic message with severity and optional code.
- DiagnosticMessageExtensions
Extension methods for working with diagnostic messages.
- DiscoveryEnumExtensions
Extension methods for discovery enums.
- GridModeExtensions
Extension methods for working with GridMode values.
- GridTilePlaceable
Core implementation of a grid tile placeable. Uses TileTypeId to identify the semantic tile type. The actual Godot tile coordinates are resolved by TileTypeMapping at runtime.
- IndicatorModel
Represents an indicator model for placement validation.
This class contains the visual data needed to show placement indicators (valid/invalid tiles, collision areas, etc.).
- InheritanceOverrides
Configuration for inheritance overrides
- InputAction
Represents an input action with associated data
- IntegrationValidationResult
Result of integration validation between systems
- ManipulationActionExtensions
Extension methods for ManipulationAction.
- ManipulationMetadata
Strongly-typed metadata for manipulation operations.
- ManipulationPhaseExtensions
Extension methods for ManipulationPhase.
- ManipulationResult
Result of a manipulation operation, capturing outcome, positions, and metadata.
Role in state pattern: Contained within ManipulationApplicationState.LastResult to describe the most recent manipulation attempt. Updated after each phase transition (Start, UpdateTarget, Confirm, Cancel).
For the complete pattern explanation and result lifecycle, see: docs/core/guides/application-state-pattern.md
Properties:
- IsSuccess / IsValid: overall outcome
- ManipulationType: which action was attempted
- OriginalPosition → NewPosition: positional delta
- AffectedPositions: any other grid cells affected
- Metadata: extensible key-value for any extra data
- ErrorMessage: human-readable failure reason if !IsSuccess
Factory methods: Use
Success(),Success(type, orig, new),Failed(msg), orFailure(msg, type)to construct results. Avoid mutable setters in new code; prefer object initializer or builder pattern when adding data.Compatibility note: This class is mutable and contains alias properties (IsValid/Message/Data) for backward compatibility with older code. New code should prefer IsSuccess, ErrorMessage, and Metadata for clarity.
- Metadata
Type-safe metadata container that stores values by their type. Provides compile-time type safety and eliminates the need for string keys.
- MouseButtonExtensions
Extension methods for MouseButton enum
- ObjectInfo
Information about a placed object at a grid position. Shown in the info panel during demolish/info modes.
- Placeable
Core placeable type for placement operations Pure C# implementation without Engine dependencies
This is the primary data structure used by UI components for displaying placeable information. UI components work directly with Core Placeables without needing Engine Resource wrappers, maintaining clean separation between engine-agnostic logic and engine-specific implementation.
UI Usage:
- Display properties: Id, Name, Description for UI labels and tooltips
- Visual properties: Size, Position for grid placement and preview rendering
- Custom data: Properties dictionary for category, cost, tags, and other UI-specific data
- Validation: IsValid flag to enable/disable UI interactions
For Engine-specific operations (scene instantiation, resource loading), use PlaceableResourceHandler.
- PlaceableCosts
Strongly-typed collection of resource costs. Replaces Dictionary<string, int> with type safety and better API.
- PlaceableResourceLoader
Handles loading and validation of placeable resource metadata. Pure C# implementation without engine dependencies.
- PlacementMetadata
Strongly-typed metadata for placement operations.
- PositioningEnumExtensions
Extension methods for positioning enums.
- PreviewModel
Represents a preview model for placement operations.
This class contains the visual and spatial data needed to render a preview of where a placeable object will be placed.
- ResourceCost
Represents a cost for a specific resource.
- StringExtensions
Extension methods for converting strings to GridMode.
- TargetingSnapshot2D
Represents a snapshot of targeting information for placement operations.
This class contains all the data needed to determine where a placeable object should be positioned and how it should be oriented.
- TileInfo
Information about a tile in the grid. Combines data from TileMapLayer and ECS occupancy.
- ValidationMetadata
Strongly-typed metadata for validation results.
Structs
- EntitySnapshot
Represents a snapshot of an entity's state at a point in time. Used for querying entity information without direct ECS references.
- FeedbackId
Strongly-typed identifier for feedback effects. Prevents string typos and provides compile-time type safety.
- ManipulationId
Strongly-typed identifier for manipulations. Prevents string typos and provides compile-time type safety.
- OwnerId
Strongly-typed identifier for owners. Prevents string typos and provides compile-time type safety.
- PlaceableId
Strongly-typed identifier for placeables. Prevents string typos and provides compile-time type safety.
- ResourceId
Strongly-typed identifier for resources. Prevents string typos and provides compile-time type safety.
- SlotId
Strongly-typed identifier for slots. Prevents string typos and provides compile-time type safety.
- TileSourceData
Tile source data for TileMap synchronization. Contains the semantic tile type ID that maps to Godot tile coordinates.
Core concept: This struct holds the semantic TileTypeId. The Godot layer (via TileTypeMapping) resolves this to (TileSetId, SourceId, AtlasCoords) when actually setting tiles in a TileMapLayer.
The name "TileSourceData" is kept for API compatibility, but the content is now Core-agnostic - only TileTypeId is stored.
- TileTypeId
Strongly-typed identifier for tile types in the grid placement system. Represents the semantic tile type (e.g., "grass", "water", "stone") separate from scene objects which use PlaceableId.
TileTypeId lives in Core (pure C#) and maps to Godot-specific tile coordinates (TileSetId, SourceId, AtlasCoords) in the moonbark-idle layer via TileTypeMapping.
Data flow: Core ECS: entity.TileTypeId = "grass" (semantic) Godot Layer: TileTypeMapping.Resolve("grass") ? (TileSetId=0, SourceId=0, AtlasCoords=(0,0)) TileMapLayer.SetCell(position, SourceId, AtlasCoords)
- WorldVisual
Represents a visual element in the world for rendering purposes. Used by Framework.Rendering to bridge MoonBark.GridPlacement visuals to Godot presentation.
Interfaces
- ICollisionShapeData
Strongly-typed description of a collision shape used by the core collision processor. Engine layers (e.g. Godot) should adapt their concrete shapes to this interface rather than passing raw objects into POCS.
Enums
- BuildType
Build type categories for placement operations.
- CategoryMergeStrategy
Strategy for merging categories during inheritance
- CenteringMode
Centering modes for grid targeting operations.
- ConfigurationFormat
Configuration format types supported for placeable loading Currently JSON-only, but extensible for future formats (YAML, TOML, etc.)
- DiagnosticSeverity
Severity level for diagnostic messages.
- FlipAxis
Axis for flip operations.
- GestureType
Gesture types for touch input
- GridMode
Primary mode enum for the grid building/placement system. Represents the current high-level tool or interaction mode the system is in.
Mode vs Action: GridMode is the tool selected (e.g., "Move tool"), while ManipulationAction is the operation performed with that tool (e.g., "Move action" when moving an entity). For move mode, the action is always Move; for rotate mode, action is Rotate.
State relationship: The active manipulation records its ManipulationApplicationState.Mode when IManipulationApplicationService.Start is called. This fixes the mode for that manipulation session (you can't switch from Move to Demolish mid-manipulation).
For mode vs action mapping and which modes support manipulation, see: docs/core/guides/application-state-pattern.md → Mode vs Action
Other modes: Info, Select, Inspect are read-only; Edit, Resize, Paint may have their own specialized workflows separate from standard manipulation.
- InputDevice
Types of input devices
- InputMode
Input modes for grid building system
- InputType
Input event types
- KeyCode
Key codes for input handling
- ManipulationAction
Actions that can be performed within the building/manipulation system. Represents discrete operations on placeable objects.
Usage: Set ManipulationApplicationState.Mode (a GridMode) to the high-level tool mode, but ManipulationType records the specific action taken (Build, Move, Rotate, FlipH/V, Demolish). For example, entering Rotate mode → GridMode.Rotate; executing a rotation → ManipulationAction.Rotate.
Aliases: Some values have synonyms for compatibility (e.g., Rotate_LEFT, Rotate_RIGHT, FLIP_HORIZONTAL, FLIP_VERTICAL). Use the canonical forms (Rotate, FlipH, FlipV) in new code.
- ManipulationOperation
Types of manipulation operations that can be performed. This is the Core-compatible version used by IPlacementBackend.
- ManipulationPhase
Phase states for manipulation operations. Represents the lifecycle progression of a manipulation operation from start to finish.
For the complete state machine diagram, see: docs/core/guides/application-state-pattern.md → State Machine Lifecycle
Guidance:
- IsActivePhase(ManipulationPhase): Starting, Active, Finalizing
- IsTerminalPhase(ManipulationPhase): Completed, Cancelled
- CanCancel(ManipulationPhase): Starting, Active only
The phase is primarily managed by the manipulation system internally. UI and simulation code typically check
IsActiveon ManipulationApplicationState rather than inspecting the phase directly.
- MouseButton
Mouse button enumeration
- MoveDirection
Movement direction constraints for grid operations.
- ObjectSearchMethod
Object search methods for finding objects in the game world.
- PlaceableMergeStrategy
Strategy for merging placeables during inheritance
- PlacementOccupancyMode
Determines which occupancy source should be preferred for placement validation.
- PositionerLogMode
Log modes for grid positioner debugging.
- ProjectionMethod
Projection method types for coordinate transformations. Used when converting between screen and world coordinates.
- RecenterPolicy
Recenter policy on enable: choose where to place the positioner when input is (re)enabled.
- RotationDirection
Direction for rotation operations.
- TargetType
Targeting types for grid building system
- TargetingMode
Enumeration of targeting modes.
- TileOffsetAxis
Tile offset axis for half-offset grids.
- TileShape
Tile shape types for grid calculations. Determines the geometry of the grid system.
- ValidationMode
Validation mode for checking placement rules.
- ValidationSeverity
Validation severity levels for placement validation.