Class ScalingRegistryHolder
java.lang.Object
io.artificial.enchantments.internal.scaling.ScalingRegistryHolder
Holder for the scaling algorithm registry instance.
This class provides access to the registry for internal components without making it a global static singleton. The registry is set during API initialization and remains immutable thereafter.
- Since:
- 0.2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScalingAlgorithmRegistryGets the registry instance.static voidinitialize(ScalingAlgorithmRegistry registryInstance) Initializes the holder with the registry instance.static booleanChecks if the holder has been initialized.
-
Method Details
-
initialize
Initializes the holder with the registry instance.This should be called once during API initialization.
- Parameters:
registryInstance- the registry instance to use- Throws:
IllegalStateException- if already initialized
-
getRegistry
Gets the registry instance.If not initialized, returns a default registry.
- Returns:
- the registry instance
-
isInitialized
public static boolean isInitialized()Checks if the holder has been initialized.- Returns:
- true if initialized
-