Table of Contents

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

bool

CanRotate

Whether this placeable can be rotated during placement Affects UI controls and placement validation

public bool CanRotate { get; set; }

Property Value

bool

Category

Category identifier for grouping and filtering String-based to allow game-specific categories and runtime customization

public string Category { get; set; }

Property Value

string

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

string

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

string

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

string

Id

Unique identifier for the placeable Used as primary key in data structures and lookup operations

public string Id { get; set; }

Property Value

string

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

int

IsValid

Validation flag for UI state management UI components should check this to enable/disable interactions

public bool IsValid { get; set; }

Property Value

bool

Name

Display name shown in UI Primary label for UI components (menus, tooltips, etc.)

public string Name { get; set; }

Property Value

string

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

Dictionary<string, object>

ResourceCost

Resource cost required to place this object Used by UI for cost display and placement validation

public PlaceableCosts ResourceCost { get; set; }

Property Value

PlaceableCosts

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

string

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

IReadOnlyList<string>

Variants

Visual variants available for this placeable (interface implementation)

public IEnumerable<PlaceableVariant> Variants { get; }

Property Value

IEnumerable<PlaceableVariant>

VariantsList

Visual variants available for this placeable Multiple visual representations while sharing core gameplay logic

public List<PlaceableVariant> VariantsList { get; set; }

Property Value

List<PlaceableVariant>