package me.km.networking;

public enum Icon {
    NULL(0, 0, 9, 9),
    FULL_HEART(9, 0, 9, 9),
    HALF_HEART(18, 0, 9, 9),
    EMPTY_HEART(27, 0, 9, 9),
    EMPTY_FOOD(36, 0, 9, 9),
    FULL_FOOD(45, 0, 9, 9),
    EMPTY_ARMOR(54, 0, 9, 9),
    HALF_ARMOR(63, 0, 9, 9),
    FULL_ARMOR(72, 0, 9, 9),
    BUBBLE(81, 0, 9, 9),
    BUBBLE_BROKEN(90, 0, 9, 9),
    FULL_MANA(9, 9, 9, 9),
    HALF_MANA(18, 9, 9, 9),
    EMPTY_MANA(27, 9, 9, 9),
    FULL_THIRST(9, 18, 9, 9),
    HALF_THIRST(18, 18, 9, 9),
    EMPTY_THIRST(27, 18, 9, 9),
    FULL_COLD(9, 27, 9, 9),
    HALF_COLD(18, 27, 9, 9),
    EMPTY_COLD(27, 27, 9, 9),
    FULL_ENERGY(9, 36, 9, 9),
    HALF_ENERGY(18, 36, 9, 9),
    EMPTY_ENERGY(27, 36, 9, 9),
    GOLD_COIN(99, 9, 9, 9),
    SILVER_COIN(108, 9, 9, 9),
    COPPER_COIN(117, 9, 9, 9),
    XP_BOTTLE(99, 0, 9, 9),
    BLUE_BOTTLE(108, 0, 9, 9),
    RED_BOTTLE(117, 0, 9, 9),
    ORANGE_BOTTLE(126, 0, 9, 9),
    LIME_BOTTLE(135, 0, 9, 9),
    GREEN_BOTTLE(144, 0, 9, 9),
    VIOLET_BOTTLE(153, 0, 9, 9),
    YELLOW_BOTTLE(162, 0, 9, 9),
    BOW(27, 45, 9, 9),
    DIAMOND_SHOVEL(36, 9, 9, 9),
    GOLD_SHOVEL(45, 9, 9, 9),
    IRON_SHOVEL(54, 9, 9, 9),
    BRONZE_SHOVEL(63, 9, 9, 9),
    COPPER_SHOVEL(72, 9, 9, 9),
    STONE_SHOVEL(81, 9, 9, 9),
    WOOD_SHOVEL(90, 9, 9, 9),
    DIAMOND_PICKAXE(36, 18, 9, 9),
    GOLD_PICKAXE(45, 18, 9, 9),
    IRON_PICKAXE(54, 18, 9, 9),
    BRONZE_PICKAXE(63, 18, 9, 9),
    COPPER_PICKAXE(72, 18, 9, 9),
    STONE_PICKAXE(81, 18, 9, 9),
    WOOD_PICKAXE(90, 18, 9, 9),
    DIAMOND_HOE(36, 27, 9, 9),
    GOLD_HOE(45, 27, 9, 9),
    IRON_HOE(54, 27, 9, 9),
    BRONZE_HOE(63, 27, 9, 9),
    COPPER_HOE(72, 27, 9, 9),
    STONE_HOE(81, 27, 9, 9),
    WOOD_HOE(90, 27, 9, 9),
    DIAMOND_AXE(36, 36, 9, 9),
    GOLD_AXE(45, 36, 9, 9),
    IRON_AXE(54, 36, 9, 9),
    BRONZE_AXE(63, 36, 9, 9),
    COPPER_AXE(72, 36, 9, 9),
    STONE_AXE(81, 36, 9, 9),
    WOOD_AXE(90, 36, 9, 9),
    DIAMOND_SWORD(36, 45, 9, 9),
    GOLD_SWORD(45, 45, 9, 9),
    IRON_SWORD(54, 45, 9, 9),
    BRONZE_SWORD(63, 45, 9, 9),
    COPPER_SWORD(72, 45, 9, 9),
    STONE_SWORD(81, 45, 9, 9),
    WOOD_SWORD(90, 45, 9, 9),
    DIAMOND_DAGGER(36, 54, 9, 9),
    GOLD_DAGGER(45, 54, 9, 9),
    IRON_DAGGER(54, 54, 9, 9),
    BRONZE_DAGGER(63, 54, 9, 9),
    COPPER_DAGGER(72, 54, 9, 9),
    STONE_DAGGER(81, 54, 9, 9),
    WOOD_DAGGER(90, 54, 9, 9),
    DIAMOND_STICK(36, 63, 9, 9),
    GOLD_STICK(45, 63, 9, 9),
    IRON_STICK(54, 63, 9, 9),
    BRONZE_STICK(63, 63, 9, 9),
    COPPER_STICK(72, 63, 9, 9),
    STONE_STICK(81, 63, 9, 9),
    WOOD_STICK(90, 63, 9, 9),
    DIAMOND_BATTLE_AXE(36, 72, 9, 9),
    GOLD_BATTLE_AXE(45, 72, 9, 9),
    IRON_BATTLE_AXE(54, 72, 9, 9),
    BRONZE_BATTLE_AXE(63, 72, 9, 9),
    COPPER_BATTLE_AXE(72, 72, 9, 9),
    STONE_BATTLE_AXE(81, 72, 9, 9),
    WOOD_BATTLE_AXE(90, 72, 9, 9),
    DIAMOND_SCEPTER(36, 81, 9, 9),
    GOLD_SCEPTER(45, 81, 9, 9),
    IRON_SCEPTER(54, 81, 9, 9),
    BRONZE_SCEPTER(63, 81, 9, 9),
    COPPER_SCEPTER(72, 81, 9, 9),
    STONE_SCEPTER(81, 81, 9, 9),
    WOOD_SCEPTER(90, 81, 9, 9),
    DIAMOND_HAMMER(36, 90, 9, 9),
    GOLD_HAMMER(45, 90, 9, 9),
    IRON_HAMMER(54, 90, 9, 9),
    BRONZE_HAMMER(63, 90, 9, 9),
    COPPER_HAMMER(72, 90, 9, 9),
    STONE_HAMMER(81, 90, 9, 9),
    WOOD_HAMMER(90, 90, 9, 9),
    FISHING_ROD(18, 45, 9, 9),
    SLING(9, 45, 9, 9),
    CROSS_BOW(0, 45, 9, 9);

    private static final Icon[] icons = Icon.values();

    private final int offsetX;
    private final int offsetY;
    private final int width;
    private final int height;

    Icon(int offsetX, int offsetY, int width, int height) {
        this.offsetX = offsetX;
        this.offsetY = offsetY;
        this.width = width;
        this.height = height;
    }

    public int getOffsetX() {
        return offsetX;
    }

    public int getOffsetY() {
        return offsetY;
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public static Icon getIcon(int i) {
        if(i < 0 || i >= icons.length) {
            return NULL;
        }
        return icons[i];
    }
}
