Ejemplo n.º 1
0
 public void Start()
 {
     _currentPhase    = GamePhase.PlayersTurn;
     CurrentBlack     = BlackCards.DrawCard();
     _cardsOnTheTable = new Dictionary <int, Card[]>();
     _playerIds       = new List <int>();
     foreach (var player in Players)
     {
         _playerIds.Add(player.Key);
     }
     _currentCzarIndex = 0;
     CurrentCzar       = Players[_playerIds[_currentCzarIndex]];
     foreach (var player in Players.Values)
     {
         for (int i = 0; i < 10; i++)
         {
             player.Hand.Add(WhiteCards.DrawCard());
         }
     }
 }
Ejemplo n.º 2
0
        public BlackCard DealBlack()
        {
            if (_currentPhase != GamePhase.CzarTurn)
            {
                throw new InvalidOperationException("Not allowed during players turn");
            }

            _cardsOnTheTable.Clear();
            _currentPhase = GamePhase.PlayersTurn;

            _currentCzarIndex++;
            if (_currentCzarIndex == _playerIds.Count)
            {
                _currentCzarIndex = 0;
            }
            CurrentCzar = Players[_playerIds[_currentCzarIndex]];

            CurrentBlack = BlackCards.DrawCard();
            return(CurrentBlack);
        }