package com.abbidot.tracker.bean

import android.os.Parcelable
import com.abbidot.tracker.base.BaseDiffBean
import kotlinx.parcelize.Parcelize

/**
 *Created  by .yzq on 2022/2/28/028.
 * @link
 * @description:围栏
 */
@Parcelize
data class FencesBean(
    var deviceId: String,
    var deviceServiceId: String,
    var fenceId: String,
    var name: String,
    var address: String,
    var imgurl: String,
    var isOn: Int,
    var radius: Int,
    var longitude: Double,
    var latitude: Double,
    var fenceShapeType: Int,// fenceShapeType 围栏类型,1是圆形，2是矩形 3是六边形
    var fenceType: Int,//围栏类型,1是Safe Zone,2是No Go Zone
    var fenceNameType: Int,//名称类型,1是home,2是Office,3是Garden,4是Park,5是Play,6是Garage,7是vegetable garden,8是River
    var longitudeA: Double,
    var latitudeA: Double,
    var longitudeB: Double,
    var latitudeB: Double,
    var longitudeC: Double,
    var latitudeC: Double,
    var longitudeD: Double,
    var latitudeD: Double,
    var longitudeE: Double,
    var latitudeE: Double,
    var longitudeF: Double,
    var latitudeF: Double,
    var longitudeCenter: Double,
    var latitudeCenter: Double,
    var ancillaryLatitude: Double,
    var ancillaryLongitude: Double,
    var ancillaryOtherLatitude: Double,
    var ancillaryOtherLongitude: Double,
    var longDistance: Int,
    var shortDistance: Int,
    var modeType: Int,//数据下发方式 1:纯ble，2:纯wifi，3:ble失败转wifi
    var startDrag: Boolean//围栏形状是否开始拖动
) : Parcelable, BaseDiffBean() {
    constructor() : this(
        "",
        "",
        "",
        "",
        "",
        "",
        1,
        0,
        0.0,
        0.0,
        1,
        1,
        1,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0,
        0,
        0,
        false
    )

    override fun isSameObject(other: Any): Boolean {
        val oldItem = other as FencesBean
        return oldItem.fenceId == fenceId
    }

    override fun hasSameContent(other: Any): Boolean {
        val oldItem = other as FencesBean
        return oldItem.isOn == isOn && oldItem.name == name && oldItem.imgurl == imgurl && oldItem.address == address && oldItem.fenceType == fenceType
    }

}
