io.github.pidoveproject.showdown.protocol.server.query.BattleRooms.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-showdown-api_3 Show documentation
Show all versions of scala-showdown-api_3 Show documentation
A Scala wrapper of Pokemon Showdown's API
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