Class EnchantRenderStateFactory

java.lang.Object
johnsmith.enchantingoverhauled.menu.enchant.controller.EnchantRenderStateFactory

public class EnchantRenderStateFactory extends Object
A factory utility that translates pure functional backend EnchantContext records into purely visual frontend EnchantRenderState records for the UI to consume.

Decouples the UI widgets from needing to understand enchantment conflict resolution logic, isolating the view from the model.

  • Constructor Details

    • EnchantRenderStateFactory

      public EnchantRenderStateFactory()
  • Method Details

    • createFrom

      public static EnchantRenderState createFrom(EnchantContext context)
      Evaluates a backend context and transforms it into a visual render state.
      Parameters:
      context - The data context representing an active slot.
      Returns:
      The built render state.
    • buildEmptyState

      public static EnchantRenderState buildEmptyState()
      Returns a blank placeholder state representing a visually empty slot with no valid target or available options.