Islands Game v0.1.11 Islands.Game View Source
Models a game
in the Game of Islands.
Inspired by the book Functional Web Development by Lance Halvorsen.
Link to this section Summary
Functions
Callback implementation for Access.fetch/2
.
Callback implementation for Access.get_and_update/3
.
Callback implementation for Access.pop/2
.
Link to this section Types
Link to this type
t()
View Sourcet() :: %Islands.Game{ name: String.t(), player1: Islands.Player.t(), player2: Islands.Player.t(), request: Islands.Request.t(), response: Islands.Response.t(), state: Islands.State.t() }
Link to this section Functions
Callback implementation for Access.fetch/2
.
Callback implementation for Access.get_and_update/3
.
Link to this function
notify_player(game, player_id)
View Sourcenotify_player(t(), Islands.PlayerID.t()) :: t()
Link to this function
opponent_id(atom)
View Sourceopponent_id(Islands.PlayerID.t()) :: Islands.PlayerID.t()
Link to this function
player_board(game, player_id)
View Sourceplayer_board(t(), Islands.PlayerID.t()) :: Islands.Board.t()
Callback implementation for Access.pop/2
.
Link to this function
update_board(game, player_id, board)
View Sourceupdate_board(t(), Islands.PlayerID.t(), Islands.Board.t()) :: t()
Link to this function
update_guesses(game, player_id, hit_or_miss, guess)
View Sourceupdate_guesses( t(), Islands.PlayerID.t(), Islands.Guesses.type(), Islands.Coord.t() ) :: t()
Link to this function
update_player(game, player_id, name, gender, pid)
View Sourceupdate_player( t(), Islands.PlayerID.t(), String.t(), Islands.Player.gender(), pid() ) :: t()
Link to this function
update_request(game, request)
View Sourceupdate_request(t(), Islands.Request.t()) :: t()
Link to this function
update_response(game, response)
View Sourceupdate_response(t(), Islands.Response.t()) :: t()
Link to this function
update_state(game, state)
View Sourceupdate_state(t(), Islands.State.t()) :: t()