Placeable

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.

Declaration

1
public class Placeable : IPlaceable

Summary

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.

Metadata

Namespace: GridPlacement.Core.Types

Source File: cs/Core/Types/Placeable.cs

Assembly: GridPlacement.Core

Type: class

Implements

  • IPlaceable

Properties

Id

1
public string Id { get; set; }

Unique identifier for the placeable Used by UI for lookup and as a key in data structures


Name

1
public string Name { get; set; }

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


Description

1
public string Description { get; set; }

Detailed description for UI tooltips and help text Provides additional context about the placeable in the UI


Position

1
public CoreVector2I Position { get; set; }

Grid position for placement Used by UI for grid positioning and preview rendering


Category

1
public string Category { get; set; }

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


CanRotate

1
public bool CanRotate { get; set; }

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


CanMirror

1
public bool CanMirror { get; set; }

Whether this placeable can be mirrored/flipped during placement Affects UI controls and available placement options


ResourceCost

1
public Dictionary<string, int> ResourceCost { get; set; }

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


VariantsList

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

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


Variants

1
public IEnumerable<PlaceableVariant> Variants { get; }

Visual variants available for this placeable (interface implementation)


Size

1
public CoreVector2I Size { get; set; }

Size dimensions for UI layout and collision detection Used by UI for grid overlay, placement preview, and space calculation


IsValid

1
public bool IsValid { get; set; }

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


FilePath

1
public string FilePath { get; set; }

File path to the scene or resource file this placeable represents Engine-agnostic path (e.g., “buildings/house.tscn”) Should always be an instantiatable .tscn file. Must be validated before attempting to use. Godot layer will convert this to res:// paths as needed.

UI Note: Generally not used directly by UI, but available for debugging or advanced features


ResourceUid

1
public string? ResourceUid { get; set; }

Godot resource UID for the file (alternative to FilePath) Used when files are referenced by UID instead of path

UI Note: Generally not used directly by UI, but available for debugging or advanced features


Properties

1
public Dictionary<string, object> Properties { get; set; }

Flexible property storage for UI-specific data Common UI properties include:

  • “category”: String for grouping/filtering in UI
  • “cost”: String or numeric value for resource display
  • “tags”: Array of strings for search/filter functionality
  • “requires_power”: Boolean for conditional UI display
  • Any custom properties needed by specific UI components

UI components should use GetValueOrDefault() with sensible defaults for robustness