fix: FRO-29 Websocket Communication (#104)

Reviewed-on: #104
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
2025-12-10 09:42:50 +01:00
committed by Janis
parent 33efc4e107
commit fa3d21e303
7 changed files with 23 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ package dto.subDTO
import de.knockoutwhist.cards.Card
import util.WebUIUtils
case class CardDTO(identifier: String, path: String, idx: Int) {
case class CardDTO(identifier: String, path: String, idx: Option[Int]) {
def toCard: Card = {
WebUIUtils.stringToCard(identifier)
@@ -13,11 +13,19 @@ case class CardDTO(identifier: String, path: String, idx: Int) {
object CardDTO {
def apply(card: Card, index: Int = 0): CardDTO = {
def apply(card: Card, index: Int): CardDTO = {
CardDTO(
identifier = WebUIUtils.cardtoString(card),
path = WebUIUtils.cardToPath(card),
idx = index
idx = Some(index)
)
}
def apply(card: Card): CardDTO = {
CardDTO(
identifier = WebUIUtils.cardtoString(card),
path = WebUIUtils.cardToPath(card),
idx = None
)
}
}