GamesEngine.Grid.Grid (games_engine v0.2.0)

Grid component - represents a collection of Coordinates

Summary

Functions

Creates a new %Grid{} struct Automatically populates the :coordinates attribute with a map of %Coordinate{}s based on the supplied dimensions

Populates a %Grid{} with %Coordinates{}

Types

@type t() :: %GamesEngine.Grid.Grid{cols: term(), coordinates: term(), rows: term()}

Functions

Link to this function

new(rows, cols)

@spec new(non_neg_integer(), non_neg_integer()) :: t()

Creates a new %Grid{} struct Automatically populates the :coordinates attribute with a map of %Coordinate{}s based on the supplied dimensions

@spec populate(t()) :: t()

Populates a %Grid{} with %Coordinates{}