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

dererXII.scalashogi_2.13.5.0.2.source-code.MoveMetrics.scala Maven / Gradle / Ivy

There is a newer version: 12.1.1
Show newest version
package shogi

final case class MoveMetrics(
    clientLag: Option[Centis] = None,
    clientMoveTime: Option[Centis] = None
) {

  // Calculate client reported lag given the server's duration for the move.
  def reportedLag(elapsed: Centis) =
    clientMoveTime.fold(clientLag)(mt => Some(elapsed - mt))
}

object MoveMetrics {
  def empty = MoveMetrics(None, None)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy