package com.autotech.we1l.items

import com.autotech.we1l.my_classes.BaseItem
import com.autotech.we1l.tools.*
import org.json.JSONObject

class Region(id: Int, name: String, private val lat: String, private val lon: String, private val tax: Int) : BaseItem(id, name) {

    constructor(regionJSON: JSONObject) : this(regionJSON.getInt(ATTR_ID), regionJSON.getString(ATTR_NAME), regionJSON.getString(ATTR_LAT),
            regionJSON.getString(ATTR_LON), regionJSON.getInt(ATTR_TAX))

    override fun toString(): String {
        return "Region(lat='$lat', lon='$lon', tax=$tax)"
    }

}