Interface StatableEntity


public interface StatableEntity
Interface representing an entity that has associated statistics. This interface provides methods to retrieve, merge, and replace statistics values.
  • Method Summary

    Modifier and Type
    Method
    Description
    Map of statistic names to their corresponding numeric values.
    default void
    Merge new statistics into the existing stats values.
    default void
    Replace the existing stats values with the new ones provided in the map.
  • Method Details

    • getStatsValues

      Map<String,Number> getStatsValues()
      Map of statistic names to their corresponding numeric values.
      Returns:
      A map containing the current statistics values for this entity, where the key is the statistic name and the value is its numeric value.
    • mergeStats

      default void mergeStats(Map<String,Number> newStats)
      Merge new statistics into the existing stats values. If a statistic already exists, it will be updated with the new value.
      Parameters:
      newStats - Map of new statistic names to their corresponding numeric values to be merged into the existing stats.
    • replaceStats

      default void replaceStats(Map<String,Number> newStats)
      Replace the existing stats values with the new ones provided in the map. This will clear the current stats and set them to the new values.
      Parameters:
      newStats - Map of new statistic names to their corresponding numeric values that will replace the existing stats.