Sternhalma.Cell (Sternhalma v0.1.1) View Source
Link to this section Summary
Functions
Puts a marble in the given cell.
Set which marble is the target in a given cell. The target is used to determine if marbles are located in their winning positions.
Link to this section Types
Specs
marble() :: nil | String.t()
Specs
t() :: %Sternhalma.Cell{ marble: marble(), position: Sternhalma.Hex.t(), target: marble() }
Represents a single spot on the board.
Link to this section Functions
Specs
Puts a marble in the given cell.
Examples
iex> set_marble(%Sternhalma.Cell{position: Sternhalma.Hex.new({0,0,0})}, "a")
%Sternhalma.Cell{marble: "a", position: %Sternhalma.Hex{x: 0, y: 0, z: 0}}
Specs
Set which marble is the target in a given cell. The target is used to determine if marbles are located in their winning positions.
Examples
iex> set_target(%Sternhalma.Cell{position: Sternhalma.Hex.new({0,0,0})}, "a")
%Sternhalma.Cell{target: "a", position: %Sternhalma.Hex{x: 0, y: 0, z: 0}}
iex> set_target(%Sternhalma.Cell{marble: "b", position: Sternhalma.Hex.new({0,0,0})}, "a")
%Sternhalma.Cell{target: "a", marble: "b", position: %Sternhalma.Hex{x: 0, y: 0, z: 0}}