Class AssetManager

java.lang.Object
dev.engine.core.asset.AssetManager

public class AssetManager extends Object
  • Constructor Details

    • AssetManager

      public AssetManager(Executor executor)
  • Method Details

    • addSource

      public void addSource(AssetSource source)
    • addSource

      public void addSource(int index, AssetSource source)
    • registerLoader

      public void registerLoader(AssetLoader<?> loader)
    • loadSync

      public <T> T loadSync(String path, Class<T> type)
    • loadAsync

      public <T> CompletableFuture<T> loadAsync(String path, Class<T> type)
    • evict

      public void evict(String path)
    • onReload

      public <T> void onReload(String path, Class<T> type, Consumer<T> callback)
    • reloadChanged

      public void reloadChanged(String path)
    • enableHotReload

      public void enableHotReload(Path watchDir)
      Enables hot-reload by watching the given directory for file changes. When a watched file is modified, it is evicted from cache, reloaded, and all registered onReload callbacks are fired.
    • watchForReload

      public void watchForReload(String path)
      Registers a file for hot-reload watching. When the file changes, the cache is evicted and the asset is reloaded, firing callbacks.
    • shutdown

      public void shutdown()
      Shuts down the asset manager, stopping the file watcher if active.