World

scalata.domain.world.World
final case class World(player: Player, difficulty: Int, rooms: Map[String, Room], roomsArrangement: List[List[String]])

Immutable game world.

Holds the current player, global difficulty, every generated room and their arrangement grid.

Attributes

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

Members list

Value members

Concrete methods

def getDifficulty: Int

Current difficulty level.

Current difficulty level.

Attributes

def getNeighbor(direction: Direction, roomId: String): Option[Room]

Get neighbouring room in the given direction, if any.

Get neighbouring room in the given direction, if any.

Attributes

The active player entity.

The active player entity.

Attributes

def getRoom(id: String): Option[Room]

Retrieve a room by id.

Retrieve a room by id.

Attributes

def updatePlayer(player: Player): World

Replace the player, returning a new world.

Replace the player, returning a new world.

Attributes

def updateRoom(room: Room): World

Replace a room, returning a new world.

Replace a room, returning a new world.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product