Islands Engine v0.2.0 Islands.Engine.Game.Grid View Source
Convenience module for client application.
Converts a board or guesses struct to a grid (map of maps). Also converts a grid to a list of maps.
Link to this section Summary
Functions
Returns an "empty" grid
Converts a board or guesses struct to a grid
Converts a grid to a list of maps
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %{
optional(Islands.Engine.Coord.row()) => %{
optional(Islands.Engine.Coord.col()) => atom()
}
}
t() :: %{ optional(Islands.Engine.Coord.row()) => %{ optional(Islands.Engine.Coord.col()) => atom() } }
Link to this section Functions
Link to this function
new()
View Source
new()
View Source
new() :: t()
new() :: t()
Returns an "empty" grid.
Link to this function
new(board_or_guesses)
View Source
new(board_or_guesses)
View Source
new(Islands.Engine.Board.t() | Islands.Engine.Guesses.t()) :: t()
new(Islands.Engine.Board.t() | Islands.Engine.Guesses.t()) :: t()
Converts a board or guesses struct to a grid.
Link to this function
to_maps(grid, fun \\ &Tile.new/1)
View Source
to_maps(grid, fun \\ &Tile.new/1)
View Source
to_maps(t(), (atom() -> IO.ANSI.Plus.ansidata())) :: [map()]
to_maps(t(), (atom() -> IO.ANSI.Plus.ansidata())) :: [map()]
Converts a grid to a list of maps.