getInitialState static method

Game<Event> getInitialState(
  1. GameConfig gameConfig,
  2. IList<Player> players
)

Will get the initial state for a particular configuration

Implementation

static Game getInitialState(GameConfig gameConfig, IList<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);
}