Class DynamicTitle.DynamicTitleImpl

java.lang.Object
io.rhythmknights.coreapi.component.module.DynamicTitle.DynamicTitleImpl
All Implemented Interfaces:
DynamicTitle
Enclosing interface:
DynamicTitle

public static class DynamicTitle.DynamicTitleImpl extends Object implements DynamicTitle
Simple implementation for creating dynamic titles with a function
  • Constructor Details

    • DynamicTitleImpl

      public DynamicTitleImpl(@NotNull @NotNull Function<Object,net.kyori.adventure.text.Component> titleFunction, @NotNull @NotNull Object state)
      Creates a dynamic title with a function that takes a state object
      Parameters:
      titleFunction - Function to generate title based on state
      state - The state object to pass to the function
  • Method Details

    • getDynamicTitle

      @NotNull public @NotNull net.kyori.adventure.text.Component getDynamicTitle()
      Description copied from interface: DynamicTitle
      Get the current dynamic title based on modal state
      Specified by:
      getDynamicTitle in interface DynamicTitle
      Returns:
      Current component title
    • update

      @NotNull public @NotNull net.kyori.adventure.text.Component update(@NotNull @NotNull Object state)
      Description copied from interface: DynamicTitle
      Update the dynamic title with a new state object
      Specified by:
      update in interface DynamicTitle
      Parameters:
      state - Object containing state information for the update
      Returns:
      Updated component title