package speiger.src.coreengine.assets.api;

import java.io.IOException;
import java.nio.file.Path;

public interface IFileWatcher {
	void addDirectory(Path basePath) throws IOException;
	void addFile(Path file) throws IOException;
	
	public static record FileWatcher(IOConsumer<Path> folder, IOConsumer<Path> file) implements IFileWatcher {
		@Override
		public void addDirectory(Path basePath) throws IOException { folder().accept(basePath); }
		@Override
		public void addFile(Path file) throws IOException { file().accept(file); }
	}
	
	public static interface IOConsumer<T> {
		void accept(T t) throws IOException;
	}
}
