MarsExplorer.HighlandGrid (SWAP - Mars Explorer v0.1.0) View Source
Module responsible for managing a highland grid
Link to this section Summary
Functions
Generates the highland grid
Determines if a position would be within the highland grid's limits
Link to this section Types
Specs
Link to this section Functions
Specs
Generates the highland grid
Examples
iex> alias MarsExplorer.HighlandGrid
MarsExplorer.HighlandGrid
iex> HighlandGrid.build(%{north: 5, east: 5})
%HighlandGrid{north_limit: 5, east_limit: 5}
Specs
Determines if a position would be within the highland grid's limits
Examples
iex> alias MarsExplorer.HighlandGrid
MarsExplorer.HighlandGrid
iex> grid = %HighlandGrid{north_limit: 5, east_limit: 5}
%HighlandGrid{north_limit: 5, east_limit: 5}
iex> grid |> HighlandGrid.valid_position?(%{north: 0, east: 0})
true
iex> grid |> HighlandGrid.valid_position?(%{north: 5, east: 5})
true
iex> grid |> HighlandGrid.valid_position?(%{north: 0, east: 6})
false
iex> grid |> HighlandGrid.valid_position?(%{north: 6, east: 0})
false