Reviewed-on: #101 Co-authored-by: Janis <janis.e.20@gmx.de> Co-committed-by: Janis <janis.e.20@gmx.de>
20 lines
588 B
Scala
20 lines
588 B
Scala
package dto
|
|
|
|
import de.knockoutwhist.control.sublogic.PlayerTieLogic
|
|
import play.api.libs.json.{Json, OFormat}
|
|
|
|
case class TieInfoDTO(currentPlayer: Option[PlayerDTO], tiedPlayers: Seq[PlayerDTO], highestAmount: Int)
|
|
|
|
object TieInfoDTO {
|
|
|
|
implicit val tieInfoFormat: OFormat[TieInfoDTO] = Json.format[TieInfoDTO]
|
|
|
|
def apply(tieInput: PlayerTieLogic): Unit = {
|
|
TieInfoDTO(
|
|
currentPlayer = tieInput.currentTiePlayer().map(PlayerDTO.apply),
|
|
tiedPlayers = tieInput.getTiedPlayers.map(PlayerDTO.apply),
|
|
highestAmount = tieInput.highestAllowedNumber()
|
|
)
|
|
}
|
|
|
|
} |