MapBasedGrid

floodsim.model.grid.MapBasedGrid
final case class MapBasedGrid[T <: GridElement](width: Int, height: Int, elementsMap: Map[Coordinate, T]) extends Grid[T]

Grid implementation backed by an immutable map Coordinate -> T. Requires positive dimensions; the presence of a map entry determines whether a cell is populated.

Value parameters

elementsMap

immutable map from coordinates to elements

height

grid height (>= 1)

width

grid width (>= 1)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Grid[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def getElementAt(coordinate: Coordinate): Option[T]

Returns the element at the specified coordinate, if present.

Returns the element at the specified coordinate, if present.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product