Beispiel #1
0
        public GameRound NextRound()
        {
            var round = GameRound.FromPlayers(_players);

            _currentRound.OnNext(round);
            return(round);
        }
Beispiel #2
0
        public static GameRound FromPlayers(IEnumerable <Player> players)
        {
            if (players == null)
            {
                throw new ArgumentNullException(nameof(players));
            }
            var round = new GameRound(players);

            return(round);
        }
Beispiel #3
0
        public void Start()
        {
            if (!_players.Any())
            {
                throw new NotSupportedException("The game should have at least one player.");
            }

            if (!_started.HasValue)
            {
                _started = DateTime.UtcNow;
            }

            var round = GameRound.FromPlayers(_players);

            _round.Add(round);
            _currentRound.OnNext(round);
        }