コード例 #1
0
ファイル: Board.cs プロジェクト: vrmarathe/startpad
 public void PrepGame()
 {
     for (int index = 0; index < _players.Count; index++)
     {
         Pile reservePile = _playerReservePile[index];
         for (int cardIndex = 0; cardIndex < Board.ReservePileMax; cardIndex++)
         {
             reservePile.Add(_drawPile.Pop());
         }
     }
 }
コード例 #2
0
ファイル: Board.cs プロジェクト: vrmarathe/startpad
        public void FillCurrentPlayersHand()
        {
            Pile playerHand = GetHand(_currentPlayer);

            if (_hasBeenFilled && playerHand.Count != 0)
            {
                throw new ApplicationException("Over-dealing cards to the same player.");
            }

            while (playerHand.Count < Board.HandSize && _drawPile.Count > 0)
            {
                playerHand.Add(_drawPile.Pop());
            }

            _hasBeenFilled = true;

            if (playerHand.Count == 0)
            {
                _isGameOver = true;
            }

            Logger.Write(string.Format("{0} Reserve({1}):{2}", playerHand.ToString("P"), GetReservePile(CurrentPlayer).Count, GetReservePile(CurrentPlayer).Top));
        }