package speiger.src.coreengine.assets.api;

import java.util.concurrent.CompletableFuture;

public interface IResourceListener {
	CompletableFuture<Void> reload(ReloadContext context, ISyncer sync);
	
	public static interface ISimpleResourceListener extends IResourceListener {
		@Override
		default CompletableFuture<Void> reload(ReloadContext context, ISyncer sync) { return CompletableFuture.runAsync(() -> reload(context), context.tasks()); }
		void reload(ReloadContext context);
	}
	
	public static interface ISyncer {
		<T> CompletableFuture<T> sync(T value);
	}
	
	
}
