package zero1hd.rhythmbullet.util;

import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.files.FileHandle;

public class GenericFileTypeHandler implements FileHandleResolver {
	private final FileHandleResolver resolver;
	
	public GenericFileTypeHandler(FileHandleResolver fileResolver) {
		resolver = fileResolver;
	}

	@Override
	public FileHandle resolve(String fileName) {
		
		if (fileName.endsWith(".p")) {
			return resolver.resolve("particles/" +fileName);
		} else if (fileName.endsWith(".ogg")) {
			return resolver.resolve("sounds/" + fileName);
		} else {
			return null;
		}
	}

}
