All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.pidoveproject.showdown.protocol.server.choice.ChoiceRequest.scala Maven / Gradle / Ivy

The newest version!
package io.github.pidoveproject.showdown.protocol.server.choice

import io.github.pidoveproject.showdown.protocol.MessageDecoder
import io.github.pidoveproject.showdown.json.nonEmptyListOrEmpty
import zio.json.*

/**
 * A choice request sent by the server.
 *
 * @param active the choices related to the active pokemon
 * @param team the choice related to the team (e.g switching)
 * @param requestId the id of the request, used to ensure the sent decision is not confused with another one
 */
case class ChoiceRequest(
    active: List[ActiveChoice],
    @jsonField("side") team: TeamChoice,
    @jsonField("rqid") requestId: Option[Int]
) derives JsonDecoder

object ChoiceRequest:

  given MessageDecoder[ChoiceRequest] = MessageDecoder.fromJson




© 2015 - 2024 Weber Informatics LLC | Privacy Policy