GameBuilder

scalata.application.services.GameBuilder
final case class GameBuilder(player: Option[Player], difficulty: Int, level: Int)

Immutable builder that assembles a complete GameSession.

==== Parameters ====

  • player optional hero to start the run with; must be supplied before calling build.
  • difficulty global difficulty level (1–10).
  • level tower floor to generate (starts at 1).

All mutator methods are pure: they return a new GameBuilder instance without mutating the original one.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def build(seed: Long): GameSession

Materialise the builder into a fully-fledged GameSession.

Materialise the builder into a fully-fledged GameSession.

Value parameters

seed

random seed forwarded to the procedural generator

Attributes

Throws
IllegalStateException

if player is absent

def withDifficulty(difficulty: Int): GameBuilder
def withLevel(level: Int): GameBuilder
def withPlayer(player: Option[Player]): GameBuilder

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product