package me.xhsun.guildwars2wrapper;

/**
 * Class that contains some utility functions
 *
 * @author xhsun
 * @since 2017-06-28
 */
public class GuildWars2Utility {
	/**
	 * get the WvW map id from WvW objective id
	 *
	 * @param id objective id
	 * @return map id | -1 if input isn't in the form of [0-9]+-[0-9]+
	 */
	public int getWvWMapID(String id) {
		String[] strIds;
		if (id.contains("-")) strIds = id.split("-");
		else return -1;
		try {
			return Integer.parseInt(strIds[0]);
		} catch (NumberFormatException e) {
			return -1;
		}
	}

	//TODO coins to gold/sliver/copper

	//TODO method to resolve back story question using answer id

	//TODO chatLinkToItemID

	//TODO method that striped html from string ie, "<a>this</a>, that" becomes ", that"
}

@@ -547,41 +547,439 @@
 %0A%0A%09/
-/TODO coins to gold/sliver/copper
+**%0A%09 * parse given coin value into number of gold, sliver, and copper%0A%09 *%0A%09 * @param value coin value%0A%09 * @return results in array: index 0 is number of gold, index 1 is number of sliver, index 2 is number of copper%0A%09 */%0A%09public long%5B%5D parseCoins(long value) %7B%0A%09%09long%5B%5D result = new long%5B3%5D;%0A%09%09long temp = value;%0A%09%09result%5B2%5D = temp %25 100;%0A%09%09temp = temp / 100;%0A%09%09result%5B1%5D = temp %25 100;%0A%09%09result%5B0%5D = temp / 100;%0A%09%09return result;%0A%09%7D
 %0A%0A%09/

add function to parse coins into respective gold, sliver, copper