io.github.pidoveproject.showdown.package.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
import io.github.iltotore.iron.*
import io.github.iltotore.iron.constraint.all.*
import io.github.pidoveproject.showdown.util.NumericTypeOps
opaque type Timestamp = Long :| GreaterEqual[0]
object Timestamp extends RefinedTypeOps[Long, GreaterEqual[0], Timestamp]:
def zero: Timestamp = 0
opaque type Count = Int :| GreaterEqual[0]
object Count extends NumericTypeOps[Int, GreaterEqual[0], Count]
opaque type ChallStr = String :| FixedLength[258]
object ChallStr extends RefinedTypeOps[String, FixedLength[258], ChallStr]
opaque type FormatName = String :| Not[Blank]
object FormatName extends RefinedTypeOps[String, Not[Blank], FormatName]:
def unapply(value: String): Option[FormatName] = this.option(value)
opaque type FormatCategoryName = String :| Not[Blank]
object FormatCategoryName extends RefinedTypeOps[String, Not[Blank], FormatCategoryName]
opaque type Generation = Int :| Positive
object Generation extends RefinedTypeOps[Int, Positive, Generation]