Class Placeable
- Namespace
- MoonBark.GridPlacement.Core.Types
- Assembly
- MoonBark.GridPlacement.Core.dll
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.
public class Placeable : IPlaceable
- Inheritance
-
Placeable
- Implements
- Derived
- Inherited Members
Properties
CanMirror
Whether this placeable can be mirrored/flipped during placement Affects UI controls and available placement options
public bool CanMirror { get; set; }
Property Value
CanRotate
Whether this placeable can be rotated during placement Affects UI controls and placement validation
public bool CanRotate { get; set; }
Property Value
Category
Category identifier for grouping and filtering String-based to allow game-specific categories and runtime customization
public string Category { get; set; }
Property Value
Description
Detailed description for UI tooltips and help text Provides additional context about the placeable in the UI
public string Description { get; set; }
Property Value
FilePath
File path to the scene or resource file this placeable represents. The format is owned by the adapter that produced this placeable and may be engine-specific. Engine-specific layers must validate before attempting to use it.
UI Note: Generally not used directly by UI, but available for debugging or advanced features
public string FilePath { get; set; }
Property Value
IconPath
Path to the icon texture for UI display. Stored as a strongly-typed property to avoid Dictionary<string, object> GC allocations.
public string? IconPath { get; set; }
Property Value
Id
Unique identifier for the placeable Used as primary key in data structures and lookup operations
public string Id { get; set; }
Property Value
IdHash
Highly optimized deterministic integer hash of the Id string. Core ECS systems strictly use this hash instead of the string pointer.
public int IdHash { get; }
Property Value
IsValid
Validation flag for UI state management UI components should check this to enable/disable interactions
public bool IsValid { get; set; }
Property Value
Name
Display name shown in UI Primary label for UI components (menus, tooltips, etc.)
public string Name { get; set; }
Property Value
Position
Grid position for placement Used by UI for grid positioning and preview rendering
public CoreVector2I Position { get; set; }
Property Value
- CoreVector2I
Properties
Custom properties for extensibility (IPlaceable interface implementation). Allows engine-specific data, mod support, and custom game logic. Kept as nullable to avoid allocation when not used - check for null before access.
public Dictionary<string, object>? Properties { get; set; }
Property Value
ResourceCost
Resource cost required to place this object Used by UI for cost display and placement validation
public PlaceableCosts ResourceCost { get; set; }
Property Value
ResourceUid
Engine-specific external identifier for the file (alternative to FilePath). Used when resources are referenced by an opaque ID instead of a path.
UI Note: Generally not used directly by UI, but available for debugging or advanced features
public string? ResourceUid { get; set; }
Property Value
Size
Size dimensions for UI layout and collision detection Used by UI for grid overlay, placement preview, and space calculation
public CoreVector2I Size { get; set; }
Property Value
- CoreVector2I
Tags
Tags for categorization and filtering. Stored as a strongly-typed property to avoid Dictionary<string, object> GC allocations.
public IReadOnlyList<string>? Tags { get; set; }
Property Value
Variants
Visual variants available for this placeable (interface implementation)
public IEnumerable<PlaceableVariant> Variants { get; }
Property Value
VariantsList
Visual variants available for this placeable Multiple visual representations while sharing core gameplay logic
public List<PlaceableVariant> VariantsList { get; set; }