package de.siphalor.was.content.pack;

import de.siphalor.was.content.resource.Resource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.stream.Stream;

/**
 * An interface for some kind of content pack
 */
public interface ContentPack {
	/**
	 * Returns a stream to all of the resources in the given location and the given file extension. Search is performed recursively.
	 * @param location The location to search
	 * @param type The file extension
	 * @return Returns a stream of all of the resources
	 */
	@NotNull
	Stream<Resource> getResources(@NotNull String location, @NotNull String type);

	/**
	 * Gets the resource with the specified identifier.
	 * @param identifier The resource identifier
	 * @return The resource or <code>null</code> if it doesn't exist
	 */
	@Nullable
	Resource getResource(@NotNull String identifier);

	/**
	 * Returns the id of the content pack
	 * @return The unique identifier
	 */
	@NotNull
	String getId();
}
