anchor.diff:  						 team = 1,
   						 players = dict:new()}, ?TIMEOUT}.
   
  +%%%%
  +%% state/3
  +%%%%
  +
  +-spec pending(Event :: term(), From :: {pid(), Tag :: term()}, StateData :: term()) -> Result when
  +	Result :: {reply, Reply, NextStateName, NewStateData}
  +			| {reply, Reply, NextStateName, NewStateData, Timeout}
  +			| {reply, Reply, NextStateName, NewStateData, hibernate}
  +			| {next_state, NextStateName, NewStateData}
  +			| {next_state, NextStateName, NewStateData, Timeout}
  +			| {next_state, NextStateName, NewStateData, hibernate}
  +			| {stop, Reason, Reply, NewStateData}
  +			| {stop, Reason, NewStateData},
  +	Reply :: term(),
  +	NextStateName :: atom(),
  +	NewStateData :: atom(),
  +	Timeout :: non_neg_integer() | infinity,
  +	Reason :: normal | term().
   pending({player_join, #{player_pid := PlayerPid, 
   						handle := Handle}},
   			_From, #state{game = BcGame,
  
positive.code: %% number of players to start game
  -define(TIMEOUT, 30000).
  
  %% exported funcs
  -export([start_link/5, 
  		 player_join/3, 
  		 player_quit/2, 
  		 player_out/2]).
  
  -export([init/1, 
  		 pending/2, 
  		 pending/3, 
  		 started/2, 
  		 terminate/3, 
  		 handle_info/3]).
  
  %% state rec
  -record(state, {game,
  
negative.code: 			end;
  		{error, Reason} = Error ->
  			{reply, Error, pending, State}
  	end;
  pending(Event, From, State) ->
  	{reply, ok, pending, State}.
  
  -spec started(Event :: term(), From :: {pid(), Tag :: term()}, StateData :: term()) -> Result when
  	Result :: {reply, Reply, NextStateName, NewStateData}
  			| {reply, Reply, NextStateName, NewStateData, Timeout}
  			| {reply, Reply, NextStateName, NewStateData, hibernate}
  			| {next_state, NextStateName, NewStateData}
  			| {next_state, NextStateName, NewStateData, Timeout}
  			| {next_state, NextStateName, NewStateData, hibernate}
  			| {stop, Reason, Reply, NewStateData}
  			| {stop, Reason, NewStateData},
  	Reply :: term(),
  	NextStateName :: atom(),
  	NewStateData :: atom(),
  	Timeout :: non_neg_integer() | infinity,
  	Reason :: normal | term().
  started(Event, From, State) ->
  	{reply, ok, started, State}.
  
  %%%%
  %% state/2
  %%%%
  
  -spec pending(Event :: timeout | term(), StateData :: term()) -> Result when
  	Result :: {next_state, NextStateName, NewStateData}
  			| {next_state, NextStateName, NewStateData, Timeout}
  			| {next_state, NextStateName, NewStateData, hibernate}
  			| {stop, Reason, NewStateData},
  	NextStateName :: atom(),
  	NewStateData :: term(),
  	Timeout :: non_neg_integer() | infinity,
  	Reason :: term().
  pending(timeout, #state{game = BcGame} = State) ->
  	GameId = bc_game:id(BcGame),
  	case quit_game(GameId) of
  