package com.gh.gamecenter.room.converter

import androidx.room.TypeConverter
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.entity.SimulatorEntity

class SimulatorConverter {
    @TypeConverter
    fun toSimulatorString(data: SimulatorEntity?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toSimulatorEntity(data: String?): SimulatorEntity {
        return data?.toObject() ?: SimulatorEntity()
    }
}