getInitialState method Null safety
- GameConfig gameConfig,
- ISet<
Player> players
Will get the initial state for a particular configuration
Implementation
static Game getInitialState(GameConfig gameConfig, ISet<Player> players) {
final initState = _initialStates[gameConfig.gameType];
if (initState == null) {
throw UnimplementedError(
'No game of that type exists in the registry ${gameConfig.gameType}');
}
return initState(gameConfig, players);
}