Пример #1
0
        public ISupplyBuilder WithGameSpec(GameSpec spec)
        {
            if (spec.IsBasicGame)
            {
                this.BasicGame();
            }

            this.WithSet(spec.DeckSet).WithPlayers(spec.Players.Count);

            return(this);
        }
Пример #2
0
 private IEnumerable <Player> BuildPlayers(GameScope gameScope, GameSpec spec)
 {
     return(spec.Players
            .Select(playerSpec => gameScope.PlayerBuilder.ForSpec(playerSpec))
            .Select(dummy => (Player)dummy).ToList());
 }
Пример #3
0
 public Game Initialize(GameSpec spec, GameScope scope)
 {
     scope.SupplyBuilder.WithGameSpec(spec);
     return(new Game(scope, BuildPlayers(scope, spec)));
 }