GenericGame.startRandom constructor

GenericGame.startRandom(
  1. IList<Player> players, {
  2. required bool multiPly,
  3. required bool simultaneousAction,
})

Creates a default initialized game where the first player is chosen at random

Implementation

factory GenericGame.startRandom(
  IList<Player> players, {
  required bool multiPly,
  required bool simultaneousAction,
}) =>
    GenericGame(
      players,
      <PlayerID>[].lock,
      <IList<double>>[].lock,
      DateTime.now(),
      <GameMessage>[].lock,
      GameStatus.Started,
      0,
      Random().nextInt(players.length),
      multiPly,
      simultaneousAction,
    );