View Source FiveHundred.GameServer (Five Hundred v0.1.0)
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Request and return the current game state.
Join a running game server
Lookup the GameServer and report if it is found. Returns a boolean.
Start a GameServer with the specified game_code as the name.
Start a new game or join an existing game.
Return the :via
tuple for referencing and interacting with a specific
GameServer.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec get_current_game_state(FiveHundred.Game.game_code()) :: FiveHundred.Game.t() | {:error, String.t()}
Request and return the current game state.
@spec join_game(FiveHundred.Game.game_code(), FiveHundred.Player.t()) :: :ok | {:error, String.t()}
Join a running game server
@spec server_found?(FiveHundred.Game.game_code()) :: boolean()
Lookup the GameServer and report if it is found. Returns a boolean.
Start a GameServer with the specified game_code as the name.
@spec start_or_join(FiveHundred.Game.game_code(), FiveHundred.Player.t()) :: {:ok, :started | :joined} | {:error, String.t()}
Start a new game or join an existing game.
Return the :via
tuple for referencing and interacting with a specific
GameServer.