public ISupplyBuilder WithGameSpec(GameSpec spec) { if (spec.IsBasicGame) { this.BasicGame(); } this.WithSet(spec.DeckSet).WithPlayers(spec.Players.Count); return(this); }
private IEnumerable <Player> BuildPlayers(GameScope gameScope, GameSpec spec) { return(spec.Players .Select(playerSpec => gameScope.PlayerBuilder.ForSpec(playerSpec)) .Select(dummy => (Player)dummy).ToList()); }
public Game Initialize(GameSpec spec, GameScope scope) { scope.SupplyBuilder.WithGameSpec(spec); return(new Game(scope, BuildPlayers(scope, spec))); }