scalata.domain.util

Members list

Type members

Classlikes

object Direction

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Direction.type
enum Direction(val dx: Int, val dy: Int)

Cardinal directions plus helpers.

Cardinal directions plus helpers.

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Enemy families rendered by a single‐char glyph.

Enemy families rendered by a single‐char glyph.

Attributes

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

High-level controller states handled by the GameEngine.

High-level controller states handled by the GameEngine.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait GameError

Enumeration of domain-level errors exchanged between use-cases, controllers and the view layer.

Enumeration of domain-level errors exchanged between use-cases, controllers and the view layer.

==== Contract ==== Each error provides:

  • message – short, end-user text shown in the UI.
  • errorCode – stable identifier useful for logs or tests.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class GameOver
class Help
class InvalidInput
class ItemNotOwned
class Undo
class UndoError
Show all
object GameError

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
GameError.type
sealed trait GameResult[+T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Error
class Success[T]
object GameResult

ADT representing the outcome of a domain operation.

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
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
GameResult.type
object Geometry

Lightweight 2-D integer geometry using an opaque type.

Lightweight 2-D integer geometry using an opaque type.

  • Point2D is represented as a tuple (x, y) but the tuple is hidden outside the module.
  • Convenience ops: Manhattan distance, 4-neighbour listing, axis-aligned range and vector addition.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Geometry.type

Item types; all print as # in the ASCII view.

Item types; all print as # in the ASCII view.

Attributes

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

All hero archetypes with combat stats.

All hero archetypes with combat stats.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait PlayerCommand

ADT for every user command parsed from the view layer.

ADT for every user command parsed from the view layer.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Attack
object Help
class Interact
class Movement
object Quit
object Undo
class Use
Show all
object PlayerCommand

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object Scala2P

Thin helper around tuProlog that:

Thin helper around tuProlog that:

  • adds Scala → Prolog implicit conversions (String, Seq);

  • provides extractors (asInt, asPoint);

  • builds a reusable Prolog engine with arbitrary clauses.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Scala2P.type

Value members

Concrete methods

def gaussianBetween(from: Double, to: Double, difficulty: Int): Int

Sample an integer in [from, to] following a Gaussian curve whose mean shifts with difficulty.

Sample an integer in [from, to] following a Gaussian curve whose mean shifts with difficulty.

Attributes

def weightedRandom(p: Double): Boolean

Bernoulli trial with success probability p.

Bernoulli trial with success probability p.

Attributes

Concrete fields

val DUST_WEIGHT: Double
val MAX_DIFFICULTY: Double
val MAX_ENEMIES: Double
val MAX_PADDING: Int
val MIN_ENEMIES: Double
val MIN_PADDING: Int
val NUM_ROWS_DUNGEON: Int
val POTION_WEIGHT: Double
val ROOMS: List[String]

Pool of room names used by the procedural generator.

Pool of room names used by the procedural generator.

Attributes

val WORLD_DIMENSIONS: (Int, Int)