package dev.fyloz.plannervio.core.model

import javafx.beans.property.SimpleLongProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.beans.property.SimpleStringProperty
import tornadofx.getValue

open class Board(
    id: Long,
    name: String,
    description: String,
    backgroundImage: BackgroundImage
) {
    val idProperty by lazy { SimpleLongProperty(this, "id", id) }
    val id by idProperty

    val nameProperty by lazy { SimpleStringProperty(this, "name", name) }
    val name by nameProperty

    val descriptionProperty by lazy { SimpleStringProperty(this, "description", description) }
    val description by descriptionProperty

    val backgroundImageProperty by lazy { SimpleObjectProperty(this, "backgroundImage", backgroundImage) }
    val backgroundImage by backgroundImageProperty
}

fun boardFactory(
    id: Long = 0L,
    name: String = "board",
    description: String = "description",
    backgroundImage: BackgroundImage = backgroundImageFactory()
): Board {
    return Board(id, name, description, backgroundImage)
}
