scalata.domain.world
Members list
Type members
Classlikes
Immutable wrapper that couples a World with its GameState and keeps an undo history.
==== Fields ====
-
world current game world (rooms, player, difficulty).
-
gameState progress on the current run.
-
history non-empty list of previous snapshots, newest first, used for the
undofeature.
All “update” methods return a new GameSession; nothing is mutated in place.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
GameSession.type
Immutable snapshot of the player’s progress on the current run.
Immutable snapshot of the player’s progress on the current run.
-
currentRoom id of the room the player is standing in.
-
visitedRooms set of room ids already explored on this floor.
-
currentLevel tower floor index (starts at
1). -
note short message shown to the user (help, errors, etc.).
All mutators return a new GameState; no in-place changes.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Immutable description of a rectangular room on a floor.
Immutable description of a rectangular room on a floor.
==== Structure ====
-
id unique room identifier (used by world graph).
-
topLeft / botRight corner coordinates that delimit the rectangle.
-
exits map
Direction → roomIdfor door connectivity. -
items loot on the ground.
-
enemies creatures currently inhabiting the room.
==== Main operations ====
- Geometry helpers (
size, border checks,isInside). - Topology helpers (
getNeighbor,getDoorPosition). - Pure mutators that return a new room (
withItems,withEnemies,removeItem). - Queries for entities at a given coordinate.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Immutable game world.
Immutable game world.
Holds the current player, global difficulty, every generated room and their arrangement grid.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all