package ru.dbotthepony.kstarbound.defs.item

import com.google.gson.JsonObject
import ru.dbotthepony.kstarbound.item.ActiveItemStack
import ru.dbotthepony.kstarbound.item.ItemRegistry
import ru.dbotthepony.kstarbound.item.ItemStack
import ru.dbotthepony.kstarbound.json.builder.IStringSerializable

enum class ItemType(override val jsonName: String, val extension: String?, val factory: (entry: ItemRegistry.Entry, config: JsonObject, parameters: JsonObject, count: Long) -> ItemStack = ::ItemStack) : IStringSerializable {
	GENERIC             ("generic",            "item"),
	LIQUID              ("liquid",             "liqitem"),
	MATERIAL            ("material",           "matitem"),
	OBJECT              ("object",              null),
	CURRENCY            ("currency",           "currency"),
	MINING_TOOL         ("miningtool",         "miningtool"),
	FLASHLIGHT          ("flashlight",         "flashlight"),
	WIRE_TOOL           ("wiretool",           "wiretool"),
	BEAM_MINING_TOOL    ("beamminingtool",     "beamaxe"),
	HARVEST_TOOL        ("harvestingtool",     "harvestingtool"),
	TILLING_TOOL        ("tillingtool",        "tillingtool"),
	PAINTING_BRUSH      ("paintingbeamtool",   "painttool"),
	HEAD_ARMOR          ("headarmor",          "head"),
	CHEST_ARMOR         ("chestarmor",         "chest"),
	LEGS_ARMOR          ("legsarmor",          "legs"),
	BACK_ARMOR          ("backarmor",          "back"),
	CONSUMABLE          ("consumable",         "consumable"),
	BLUEPRINT           ("blueprint",          "blueprint"),
	CODEX               ("codex",              null),
	INSPECTION_TOOL     ("inspectiontool",     "inspectiontool"),
	PLAYING_INSTRUMENT  ("instrument",         "instrument"),
	THROWABLE           ("thrownitem",         "thrownitem"),
	UNLOCK              ("unlockitem",         "unlock"),
	ACTIVE              ("activeitem",         "activeitem",            ::ActiveItemStack),
	AUGMENT             ("augmentitem",        "augment");
}
