package com.github.to2mbn.jmccc.mcdownloader;

import java.util.Set;
import com.github.to2mbn.jmccc.mcdownloader.download.DownloadTask;
import com.github.to2mbn.jmccc.option.MinecraftDirectory;
import com.github.to2mbn.jmccc.version.Library;

public interface MinecraftDownloader {

	/**
	 * Returns a version list download task.
	 * 
	 * @return a version list download task
	 */
	DownloadTask<RemoteVersionList> versionList();

	/**
	 * Returns an asset index download task.
	 * 
	 * @param mcdir the minecraft dir
	 * @param version the asset index version
	 * @return an asset index download task
	 */
	DownloadTask<Set<Asset>> assetsIndex(MinecraftDirectory mcdir, String version);

	/**
	 * Returns a game jar download task.
	 * <p>
	 * The jar is saved to <code>${mcdir}/versions/${version}/${version}.jar</code>. If the file already exists, this
	 * method will overwrite the file.
	 * 
	 * @param mcdir the minecraft dir
	 * @param version the game version
	 * @return a game jar download task
	 */
	DownloadTask<?> gameJar(MinecraftDirectory mcdir, String version);

	/**
	 * Returns a library download task.
	 * <p>
	 * The library is saved to <code>${mcdir}/libraries/${library.getPath()}</code>. If the file already exists, this
	 * method will overwrite the file.
	 * 
	 * @param mcdir the minecraft dir
	 * @param library the library to download
	 * @return a library download task
	 */
	DownloadTask<?> library(MinecraftDirectory mcdir, Library library);

	/**
	 * Returns an asset download task.
	 * <p>
	 * The asset is saved to <code>${mcdir}/assets/objects/${2-character-prefix of hash}/${hash}</code>. If the file
	 * already exists, this method will overwrite the file.
	 * 
	 * @param mcdir the minecraft dir
	 * @param asset the asset to download
	 * @return an asset download task
	 */
	DownloadTask<?> asset(MinecraftDirectory mcdir, Asset asset);

}

@@ -462,32 +462,129 @@
  download task.%0A
+%09 * %3Cp%3E%0A%09 * The asset index will also be saved to %3Ccode%3E$%7Bmcdir%7D/indexes/$%7Bversion%7D.json%3C/code%3E.%0A
 %09 * %0A%09 * @param 

update assetsIndex()