Files
KnockOutWhist-Web/knockoutwhistweb/app/dto/subDTO/CardDTO.scala
Janis 8d697fd311 feat: BAC-30 Implement Jackson Mapping via DTOs (#102)
Reviewed-on: #102
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
2025-12-06 10:17:04 +01:00

24 lines
428 B
Scala

package dto.subDTO
import de.knockoutwhist.cards.Card
import util.WebUIUtils
case class CardDTO(identifier: String, path: String, idx: Int) {
def toCard: Card = {
WebUIUtils.stringToCard(identifier)
}
}
object CardDTO {
def apply(card: Card, index: Int = 0): CardDTO = {
CardDTO(
identifier = WebUIUtils.cardtoString(card),
path = WebUIUtils.cardToPath(card),
idx = index
)
}
}