package dev.fyloz.plannervio.core.model

import javafx.beans.property.SimpleListProperty
import javafx.beans.property.SimpleStringProperty
import tornadofx.getValue
import tornadofx.toObservable

class PrivateBoard(
    id: Long,
    name: String,
    description: String,
    backgroundImage: BackgroundImage,
    password: String,
    users: MutableList<User>
) : Board(id, name, description, backgroundImage) {
    val passwordProperty = SimpleStringProperty(this, "password", password)
    val password by passwordProperty

    val usersProperty = SimpleListProperty(this, "users", users.toObservable())
    val users by usersProperty
}

fun privateBoardFactory(
    id: Long = 0L,
    name: String = "private board",
    description: String = "description",
    backgroundImage: BackgroundImage = backgroundImageFactory(),
    password: String = "password",
    users: MutableList<User> = mutableListOf()
): PrivateBoard {
    return PrivateBoard(id, name, description, backgroundImage, password, users)
}
