模块 linlang.api

接口 DynamicAreaView


public interface DynamicAreaView
一组按布局顺序排列、可绑定 GuiRow 的动态槽位。
  • 方法详细资料

    • id

      String id()
      返回:
      动态区 ID
    • capacity

      int capacity()
      返回:
      动态区槽位数量
    • clear

      清空动态区并解除全部行绑定。
      返回:
      当前动态区
    • fill

      DynamicAreaView fill(List<? extends GuiRow> rows)
      按区域的 overflow 策略顺序填充行。
      参数:
      rows - 待填充行;为 null 时仅清空区域
      返回:
      当前动态区
    • set

      DynamicAreaView set(int index, GuiRow row)
      设置指定区域索引的行。
      参数:
      index - 从零开始的区域索引
      row - 新行;为 null 时清除该位置
      返回:
      当前动态区;索引越界时不执行操作
    • push

      在当前绑定末尾追加一行。
      参数:
      row - 待追加行
      返回:
      当前动态区;容量已满时不执行操作
    • get

      GuiRow get(int index)
      获取指定区域索引的行绑定。
      参数:
      index - 从零开始的区域索引
      返回:
      行绑定;未绑定或索引越界时为 null
    • forEach

      void forEach(BiConsumer<Integer,GuiRow> consumer)
      按区域索引遍历当前行绑定。
      参数:
      consumer - 接收区域索引和行的回调