package com.pixelized.shared.lwa.model.item.factory

import com.pixelized.shared.lwa.model.item.Item
import com.pixelized.shared.lwa.model.item.ItemJson
import com.pixelized.shared.lwa.model.item.ItemJsonV1

class ItemJsonFactory(
    private val v1: ItemJsonFactoryV1,
) {
    fun convertFromJson(json: ItemJson): Item {
        return when (json) {
            is ItemJsonV1 -> v1.convertFromJson(json = json)
        }
    }

    fun convertToJson(item: Item): ItemJson {
        return v1.convertToJson(item = item)
    }
}