func (f Flags) gameConfig(timeFunc func() int64) gameController.Config {
	playerCfg := playerController.Config{
		WinPoints: 10,
	}
	rand.Seed(timeFunc())
	shuffleUnusedTilesFunc := func(tiles []tile.Tile) {
		rand.Shuffle(len(tiles), func(i, j int) {
			tiles[i], tiles[j] = tiles[j], tiles[i]
		})
	}
	shufflePlayersFunc := func(sockets []player.Name) {
		rand.Shuffle(len(sockets), func(i, j int) {
			sockets[i], sockets[j] = sockets[j], sockets[i]
		})
	}
	cfg := gameController.Config{
		Debug:                  f.DebugGame,
		TimeFunc:               timeFunc,
		MaxPlayers:             6,
		PlayerCfg:              playerCfg,
		NumNewTiles:            21,
		TileLetters:            "", // 144 default tiles = 144-6*21 = 18 tiles left, which leaves a maximum of 3 snags
		IdlePeriod:             60 * time.Minute,
		ShuffleUnusedTilesFunc: shuffleUnusedTilesFunc,
		ShufflePlayersFunc:     shufflePlayersFunc,
	}
	return cfg
}
// gameConfig creates the base configuration for all games.
gameConfig creates the base configuration for all games.
// gameConfig creates the base configuration for all games .
func (f Flags) gameConfig(timeFunc func() int64) gameController.Config {
	playerCfg := playerController.Config{
		WinPoints: 10,
	}
	rand.Seed(timeFunc())
	shuffleUnusedTilesFunc := func(tiles []tile.Tile) {
		rand.Shuffle(len(tiles), func(i, j int) {
			tiles[i], tiles[j] = tiles[j], tiles[i]
		})
	}
	shufflePlayersFunc := func(sockets []player.Name) {
		rand.Shuffle(len(sockets), func(i, j int) {
			sockets[i], sockets[j] = sockets[j], sockets[i]
		})
	}
	cfg := gameController.Config{
		Debug:                  f.DebugGame,
		TimeFunc:               timeFunc,
		MaxPlayers:             6,
		PlayerCfg:              playerCfg,
		NumNewTiles:            21,
		TileLetters:            "", 
		IdlePeriod:             60 * time.Minute,
		ShuffleUnusedTilesFunc: shuffleUnusedTilesFunc,
		ShufflePlayersFunc:     shufflePlayersFunc,
	}
	return cfg
}
func ( f Flags ) gameConfig ( timeFunc func ( ) int64 ) gameController . Config { playerCfg := playerController . Config { WinPoints : 10 , } rand . Seed ( timeFunc ( ) ) shuffleUnusedTilesFunc := func ( tiles [ ] tile . Tile ) { rand . Shuffle ( len ( tiles ) , func ( i , j int ) { tiles [ i ] , tiles [ j ] = tiles [ j ] , tiles [ i ] } ) } shufflePlayersFunc := func ( sockets [ ] player . Name ) { rand . Shuffle ( len ( sockets ) , func ( i , j int ) { sockets [ i ] , sockets [ j ] = sockets [ j ] , sockets [ i ] } ) } cfg := gameController . Config { Debug : f . DebugGame , TimeFunc : timeFunc , MaxPlayers : 6 , PlayerCfg : playerCfg , NumNewTiles : 21 , TileLetters : " " , IdlePeriod : 60 * time . Minute , ShuffleUnusedTilesFunc : shuffleUnusedTilesFunc , ShufflePlayersFunc : shufflePlayersFunc , } return cfg }
gameConfig creates the base configuration for all games.
gameConfig creates the base configuration for all games .
// 144 default tiles = 144-6*21 = 18 tiles left, which leaves a maximum of 3 snags