classDiagram
   Terrain Generation
  class TerrainGeneration {
    +noiseLayers: "List<NoiseLayer>"
    +faultMap: "float[][]"
    +elevationCurve: AnimationCurve
  }

  class Heatmaps {
    +temperature: "float[][]"
    +humidity: "float[][]"
    +altitude: "float[][]"
    +drainage: "float[][]"
  }

  class Biome {
    +rainfall: "Range"
    +temperature: "Range"
    +elevation: "Range"
    +flora: "List<Entity>"
    +fauna: "List<Entity>"
    +geology: GeologicalData
  }

  TerrainGeneration ..> Heatmaps : produces
  Heatmaps ..> Biome : determines

   Grid Anchor System
  class GridAnchor {
    +position: Vector2
    +anchorType: GridAnchorType
    +occupant: Entity
  }

  class GridAnchorType {
    <<enumeration>>
    Tile
    Border
    Intersection
  }

  class AnchorMap {
    +anchors: "Dict<Vector2, GridAnchor>"
    +occupiedPositions: "Set<Vector2>"
    +getAnchor(pos: Vector2) GridAnchor
    +occupy(pos: Vector2, entity: Entity) void
    +release(pos: Vector2) void
    +isOccupied(pos: Vector2) bool
  }

  Tile "1" -- "1" GridAnchor : centerAnchor
  GridAnchor "1" -- "0..1" Tile : tile
  AnchorMap "1" *-- "*" GridAnchor : anchors
  GridAnchor "1" -- "0..1" Entity : occupant
  GridAnchorType -- GridAnchor : anchorType

   Construction Recipes & Materials
  class Recipe {
    +name: string
    +prefab: GameObject
    +occupiedSlots: "List<SlotOccupation>"
    +parts: "List<ConstructionPart>"
    +placementRules: "List<PlacementRule>"
    +rotations: "List<RotationData>"
  }

  class SlotOccupation {
    +slotType: SlotType
  }

  class ConstructionPart {
    +partName: string
    +acceptedMaterials: "List<MaterialOption>"
  }

  class MaterialOption {
    +minItemId: string
    +texture: Texture2D
  }

  class RotationData {
    +rotationAngle: float
    +slotOverrides: "List<SlotOccupation>"
  }

  class PlacementRule {
    +description: string
    +validate(tile: Tile) bool
  }

  Construction ..> Recipe : uses
  Recipe "1" *-- "*" SlotOccupation : occupies
  Recipe "1" *-- "*" ConstructionPart : defines
  Recipe "1" *-- "*" PlacementRule : rules
  Recipe "1" *-- "*" RotationData : rotations
  ConstructionPart "1" *-- "*" MaterialOption : accepts
  RotationData "1" *-- "*" SlotOccupation : overrides

  %% Item System
  class ItemData {
    +id: string
    +tint: Color
    +components: "List<ItemComponent>"
  }

  class ItemComponent {
    <<abstract>>
  }

  class Consumable {
    +isPercentageBased: bool
  }

  class Flammable {
    +flammability: float
  }

  class Metallic {
    +reflectiveness: float
    +meltingPoint: float
    +hardness: float
    +electricConductiveness: float
    +corrosionResistance: float
  }

  class Nutritional {
    +calories: float
  }
  
  class Weight {
    +value: float
  }

  class Stackable {
    +maxStack: int
  }

  class Equippable {
    +neededLimbs: "List<LimbType>"
    +occupiedSlots: "List<LimbSlot>"
  }

  class ObjectiveValue {
    +baseValue: float
  }

  class EntityPrefab {
    +entity: ItemEntity
  }

  ItemData "1" *-- "*" ItemComponent : components
  ItemComponent <|-- Consumable
  ItemComponent <|-- Flammable
  ItemComponent <|-- Metallic
  ItemComponent <|-- Nutritional
  ItemComponent <|-- Weight
  ItemComponent <|-- Stackable
  ItemComponent <|-- Equippable
  ItemComponent <|-- ObjectiveValue
  ItemComponent <|-- EntityPrefab
  MaterialOption "1" -- "1" ItemData : selects