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>
This commit is contained in:
18
knockoutwhistweb/app/dto/subDTO/RoundDTO.scala
Normal file
18
knockoutwhistweb/app/dto/subDTO/RoundDTO.scala
Normal file
@@ -0,0 +1,18 @@
|
||||
package dto.subDTO
|
||||
|
||||
import de.knockoutwhist.cards.Card
|
||||
import de.knockoutwhist.cards.CardValue.Ace
|
||||
|
||||
case class RoundDTO(trumpSuit: CardDTO, firstRound: Boolean, tricklist: List[TrickDTO])
|
||||
|
||||
object RoundDTO {
|
||||
|
||||
def apply(round: de.knockoutwhist.rounds.Round): RoundDTO = {
|
||||
RoundDTO(
|
||||
trumpSuit = CardDTO(Card(Ace, round.trumpSuit)),
|
||||
firstRound = round.firstRound,
|
||||
tricklist = round.tricklist.map(trick => TrickDTO(trick))
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user