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

io.github.pidoveproject.showdown.protocol.server.query.BattleRooms.scala Maven / Gradle / Ivy

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

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

/**
 * The list of battle rooms.
 *
 * @param rooms a Map assciating a room name to its info
 */
case class BattleRooms(rooms: Map[String, BattleRoomInfo]) derives JsonDecoder

object BattleRooms:

  def from(entries: (String, BattleRoomInfo)*): BattleRooms = BattleRooms(entries.toMap)

  given MessageDecoder[BattleRooms] = MessageDecoder.fromJson




© 2015 - 2024 Weber Informatics LLC | Privacy Policy