public Match(params string[] roles) { Random = new Random(); Id = Guid.NewGuid(); var roleSetup = new RoleSetup(roles); Setup = new Setup(roleSetup); AllPlayers = Setup.Roles.Static(this); Controllers = AllPlayers.Select(player => player.Controller).ToList(); Graveyard = new Graveyard(this); Phase = new PhaseManager(this); Executor = new AbilityExecutor(this); }
public Match(Guid id, ISetup setup, IList <ILobbyController> controllers) { Random = new Random(); Id = id; Setup = setup; if (!setup.Roles.Randomize(Random, this, controllers, out var players)) { throw new ArgumentException($"Invalid setup {setup}"); } AllPlayers = players.OrderBy(player => player.Number).ToList(); Controllers = AllPlayers.Select(player => player.Controller).ToList(); Graveyard = new Graveyard(this); Phase = new PhaseManager(this); }