package de.kif.common.model

import kotlinx.serialization.Serializable

@Serializable
data class RoomBlock(
    val day: Int,
    val start: Int? = null,
    val end: Int? = null
) {
    fun checkBlock(day: Int, start: Int, end: Int): Boolean {
        if (this.day != day) return false

        val s = this.start ?: Int.MIN_VALUE
        val e = this.end ?: Int.MAX_VALUE

        return s <= end && start < e
    }
}
