GameResult

scalata.domain.util.GameResult
See theGameResult companion trait
object GameResult

ADT representing the outcome of a domain operation.

==== Cases ====

  • Success[T] – carries a value of type T and an optional user-facing message.

  • Error – wraps a non-recoverable GameError.

Helper constructors success and error make call-sites concise.

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
GameResult.type

Members list

Type members

Classlikes

case class Error(error: GameError) extends GameResult[Nothing]

Failure outcome carrying a domain-level error.

Failure outcome carrying a domain-level error.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait GameResult[Nothing]
class Object
trait Matchable
class Any
Show all
case class Success[T](value: T, message: Option[String]) extends GameResult[T]

Successful outcome.

Successful outcome.

Value parameters

message

optional note to show in the UI (help text, info, …)

value

payload returned by the operation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait GameResult[T]
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def error(error: GameError): GameResult[Nothing]

Convenience factory for Error.

Convenience factory for Error.

Attributes

def success[T](value: T, message: Option[String]): GameResult[T]

Convenience factory for Success.

Convenience factory for Success.

Attributes