/*
 * Copyright (c) 2017, Seth <Sethtroll3@gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package net.runelite.client.plugins.jewellerycount;

import java.util.HashMap;
import java.util.Map;

import static net.runelite.api.ItemID.*;
import static net.runelite.client.plugins.jewellerycount.JewelleryType.*;

public enum JewelleryCharges
{
	GLORY1(GLORY, AMULET_OF_GLORY1, 1),
	GLORY2(GLORY, AMULET_OF_GLORY2, 2),
	GLORY3(GLORY, AMULET_OF_GLORY3, 3),
	GLORY4(GLORY, AMULET_OF_GLORY4, 4),
	GLORY5(GLORY, AMULET_OF_GLORY5, 5),
	GLORY6(GLORY, AMULET_OF_GLORY6, 6),
	GLORYT1(GLORY, AMULET_OF_GLORY_T1, 1),
	GLORYT2(GLORY, AMULET_OF_GLORY_T2, 2),
	GLORYT3(GLORY, AMULET_OF_GLORY_T3, 3),
	GLORYT4(GLORY, AMULET_OF_GLORY_T4, 4),
	GLORYT5(GLORY, AMULET_OF_GLORY_T5, 5),
	GLORYT6(GLORY, AMULET_OF_GLORY_T6, 6),
	ROD1(ROD, RING_OF_DUELING1, 1),
	ROD2(ROD, RING_OF_DUELING2, 2),
	ROD3(ROD, RING_OF_DUELING3, 3),
	ROD4(ROD, RING_OF_DUELING4, 4),
	ROD5(ROD, RING_OF_DUELING5, 5),
	ROD6(ROD, RING_OF_DUELING6, 6),
	ROD7(ROD, RING_OF_DUELING7, 7),
	ROD8(ROD, RING_OF_DUELING8, 8),
	GAMES1(GAMES, GAMES_NECKLACE1, 1),
	GAMES2(GAMES, GAMES_NECKLACE2, 2),
	GAMES3(GAMES, GAMES_NECKLACE3, 3),
	GAMES4(GAMES, GAMES_NECKLACE4, 4),
	GAMES5(GAMES, GAMES_NECKLACE5, 5),
	GAMES6(GAMES, GAMES_NECKLACE6, 6),
	GAMES7(GAMES, GAMES_NECKLACE7, 7),
	GAMES8(GAMES, GAMES_NECKLACE8, 8),
	ROW1(ROW, RING_OF_WEALTH_1, 1),
	ROW2(ROW, RING_OF_WEALTH_2, 2),
	ROW3(ROW, RING_OF_WEALTH_3, 3),
	ROW4(ROW, RING_OF_WEALTH_4, 4),
	ROW5(ROW, RING_OF_WEALTH_5, 5),
	ROS1(ROS, SLAYER_RING_1, 1),
	ROS2(ROS, SLAYER_RING_2, 2),
	ROS3(ROS, SLAYER_RING_3, 3),
	ROS4(ROS, SLAYER_RING_4, 4),
	ROS5(ROS, SLAYER_RING_5, 5),
	ROS6(ROS, SLAYER_RING_6, 6),
	ROS7(ROS, SLAYER_RING_7, 7),
	ROS8(ROS, SLAYER_RING_8, 8),
	SKILLS1(SKILLS, SKILLS_NECKLACE1, 1),
	SKILLS2(SKILLS, SKILLS_NECKLACE2, 2),
	SKILLS3(SKILLS, SKILLS_NECKLACE3, 3),
	SKILLS4(SKILLS, SKILLS_NECKLACE4, 4),
	SKILLS5(SKILLS, SKILLS_NECKLACE5, 5),
	SKILLS6(SKILLS, SKILLS_NECKLACE6, 6),
	CBRACE1(CBRACE, COMBAT_BRACELET1, 1),
	CBRACE2(CBRACE, COMBAT_BRACELET2, 2),
	CBRACE3(CBRACE, COMBAT_BRACELET3, 3),
	CBRACE4(CBRACE, COMBAT_BRACELET4, 4),
	CBRACE5(CBRACE, COMBAT_BRACELET5, 5),
	CBRACE6(CBRACE, COMBAT_BRACELET6, 6),
	DIGSITE1(DIGSITE, DIGSITE_PENDANT_1, 1),
	DIGSITE2(DIGSITE, DIGSITE_PENDANT_2, 2),
	DIGSITE3(DIGSITE, DIGSITE_PENDANT_3, 3),
	DIGSITE4(DIGSITE, DIGSITE_PENDANT_4, 4),
	DIGSITE5(DIGSITE, DIGSITE_PENDANT_5, 5),
	PASSAGE5(PASSAGE, NECKLACE_OF_PASSAGE5, 5),
	PASSAGE4(PASSAGE, NECKLACE_OF_PASSAGE4, 4),
	PASSAGE3(PASSAGE, NECKLACE_OF_PASSAGE3, 3),
	PASSAGE2(PASSAGE, NECKLACE_OF_PASSAGE2, 2),
	PASSAGE1(PASSAGE, NECKLACE_OF_PASSAGE1, 1),
	BURNING5(BURNING, BURNING_AMULET5, 5),
	BURNING4(BURNING, BURNING_AMULET4, 4),
	BURNING3(BURNING, BURNING_AMULET3, 3),
	BURNING2(BURNING, BURNING_AMULET2, 2),
	BURNING1(BURNING, BURNING_AMULET1, 1),
	RETURNING5(RETURNING, RING_OF_RETURNING5, 5),
	RETURNING4(RETURNING, RING_OF_RETURNING4, 4),
	RETURNING3(RETURNING, RING_OF_RETURNING3, 3),
	RETURNING2(RETURNING, RING_OF_RETURNING2, 2),
	RETURNING1(RETURNING, RING_OF_RETURNING1, 1),
	TCRYSTAL5(TCRYSTAL, TELEPORT_CRYSTAL_5, 5),
	TCRYSTAL4(TCRYSTAL, TELEPORT_CRYSTAL_4, 4),
	TCRYSTAL3(TCRYSTAL, TELEPORT_CRYSTAL_3, 3),
	TCRYSTAL2(TCRYSTAL, TELEPORT_CRYSTAL_2, 2),
	TCRYSTAL1(TCRYSTAL, TELEPORT_CRYSTAL_1, 1),
	PHARAO8(PHARAO, PHARAOHS_SCEPTRE_8, 8),
	PHARAO7(PHARAO, PHARAOHS_SCEPTRE_7, 7),
	PHARAO6(PHARAO, PHARAOHS_SCEPTRE_6, 6),
	PHARAO5(PHARAO, PHARAOHS_SCEPTRE_5, 5),
	PHARAO4(PHARAO, PHARAOHS_SCEPTRE_4, 4),
	PHARAO3(PHARAO, PHARAOHS_SCEPTRE_3, 3),
	PHARAO2(PHARAO, PHARAOHS_SCEPTRE_2, 2),
	PHARAO1(PHARAO, PHARAOHS_SCEPTRE_1, 1),
	WSKIN4(WATERSKIN, WATERSKIN4, 4),
	WSKIN3(WATERSKIN, WATERSKIN3, 3),
	WSKIN2(WATERSKIN, WATERSKIN2, 2),
	WSKIN1(WATERSKIN, WATERSKIN1, 1),
	WSKIN0(WATERSKIN, WATERSKIN0, 0),
	IMP_IN_A_BOX1(IMP_IN_A_BOX, IMPINABOX1, 1),
	IMP_IN_A_BOX2(IMP_IN_A_BOX, IMPINABOX2, 2),
	ELYRE1(ELYRE, ENCHANTED_LYRE1, 1),
	ELYRE2(ELYRE, ENCHANTED_LYRE2, 2),
	ELYRE3(ELYRE, ENCHANTED_LYRE3, 3),
	ELYRE4(ELYRE, ENCHANTED_LYRE4, 4),
	ELYRE5(ELYRE, ENCHANTED_LYRE5, 5);

	private final JewelleryType type;
	private final int id;
	private final int charges;

	private static final Map<Integer, JewelleryCharges> ITEM_ID = new HashMap<>();

	static
	{
		for (JewelleryCharges s : values())
		{
			ITEM_ID.put(s.getId(), s);
		}
	}

	JewelleryCharges(JewelleryType type, int ID, int charges)
	{
		this.type = type;
		this.id = ID;
		this.charges = charges;
	}

	public JewelleryType getType()
	{
		return type;
	}

	public int getId()
	{
		return id;
	}

	public int getCharges()
	{
		return charges;
	}

	public static JewelleryCharges getCharges(int id)
	{
		return ITEM_ID.get(id);
	}
}
