Interface Component

All Known Implementing Classes:
Hierarchy, MaterialData, MeshData, TextureData, Transform

public interface Component
Marker interface for all components.

Components are data attached to entities. Each entity has at most one component per slotType(). By default, the slot is the concrete class. Override to share a slot across types (e.g. all material types share one slot).

  • Method Summary

    Modifier and Type
    Method
    Description
    default Class<? extends Component>
    The slot type this component occupies on an entity.
  • Method Details

    • slotType

      default Class<? extends Component> slotType()
      The slot type this component occupies on an entity. Only one component per slot type is allowed.

      Default: the concrete class. Override for families:

      sealed interface MaterialData extends Component {
          default Class<?> slotType() { return MaterialData.class; }
      }