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.
	 * <p>
	 * The asset index will also be saved to <code>${mcdir}/indexes/${version}.json</code>.
	 * 
	 * @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);

}

@@ -794,36 +794,32 @@
  Returns a game 
-jar 
 download task.%0A%09
@@ -898,32 +898,124 @@
 ion%7D.jar%3C/code%3E.
+ The version json is saved to%0A%09 * %3Ccode%3E$%7Bmcdir%7D/versions/$%7Bversion%7D/$%7Bversion%7D.json%3C/code%3E.
  If the file alr
@@ -1023,36 +1023,32 @@
 ady exists, this
-%0A%09 *
  method will ove
@@ -1045,32 +1045,36 @@
 d will overwrite
+%0A%09 *
  the file.%0A%09 * %0A
@@ -1163,20 +1163,16 @@
  a game 
-jar 
 download
@@ -1207,11 +1207,8 @@
 game
-Jar
 (Min

update game download