//
//  TSLightModel.swift
//  Girly
//
//  Created by 100Years on 2025/1/7.
//


import ObjectMapper

let kLightShared = TSLightData.shared
class TSLightData{
    
    static var shared = TSLightData()
    
    var solidColors:[TSLightItemModel] = [TSLightItemModel]()
    var gradientColors:[TSLightItemModel] = [TSLightItemModel]()
    var shapes:[TSLightItemModel] = [TSLightItemModel]()
    
    init() {
        if let solidColors = Mapper<TSLightItemModel>().mapArray(JSONfile: "SolidColors.json"){
            self.solidColors = solidColors
        }
        
        if let gradientColors = Mapper<TSLightItemModel>().mapArray(JSONfile: "GradientColors.json"){
            self.gradientColors = gradientColors
        }
        
        if let shapes = Mapper<TSLightItemModel>().mapArray(JSONfile: "LightShape.json"){
            self.shapes = shapes
        }
    }

}

class TSLightItemModel:TSBaseModel {
    var color:String = "#FFFFFF"
    var vip:Bool = false
    var image:String = ""
    override func mapping(map: ObjectMapper.Map) {
        color <- map["color"]
        vip <- map["vip"]
        image <- map["image"]
    }
}
