package com.mwudka.aftflight.core

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty

class StationIdentifier(val id: String) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as StationIdentifier

        if (id != other.id) return false

        return true
    }

    override fun hashCode(): Int {
        return id.hashCode()
    }

    override fun toString(): String {
        return "StationIdentifier(id='$id')"
    }
}

enum class SkyCover {
    SKC, CLR, CAVOK, FEW, SCT, BKN, OVC, OVX, NSC
}

data class SkyCondition(
        @JacksonXmlProperty(isAttribute = true, localName = "sky_cover") val skyCover: SkyCover,
        @JacksonXmlProperty(isAttribute = true, localName = "cloud_base_ft_agl") val cloudBaseFTAGL: Int? = null
) {
    override fun toString(): String {
        return "SkyCondition(skyCover=$skyCover, cloudBaseFTAGL=$cloudBaseFTAGL)"
    }
}
