GameState

scalata.domain.world.GameState
final case class GameState(currentRoom: String, visitedRooms: Set[String], currentLevel: Int, note: String)

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

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

Members list

Value members

Concrete methods

Advance to the next tower level.

Advance to the next tower level.

Attributes

def setRoom(newRoom: String): GameState

Move the player to a new room and mark it as visited.

Move the player to a new room and mark it as visited.

Attributes

def withNote(note: String): GameState

Replace the note shown to the user.

Replace the note shown to the user.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product