View Source Islands.Client.Player (Islands Client Player v0.1.34)

Models a player in the Game of Islands.

Inspired by the course Elixir for Programmers by Dave Thomas.

Link to this section Summary

Functions

Reacts to a client state, makes a move and repeats until the game is over.

Link to this section Functions

Specs

Reacts to a client state, makes a move and repeats until the game is over.

Player1 reacts to game state:

  • :initialized by waiting for game state :players_set
  • :players_set by waiting for game state :player1_turn
  • :player2_turn by waiting for game state :player1_turn or :game_over
  • :game_over by ending the game

Player2 reacts to game state:

  • :players_set by waiting for game state :player2_turn
  • :player1_turn by waiting for game state :player2_turn or :game_over
  • :game_over by ending the game