Belot.BelotGame.RaiseDealCompleted C# (CSharp) Метод

RaiseDealCompleted() приватный Метод

Raises the DealCompleted event
private RaiseDealCompleted ( ) : void
Результат void
        internal void RaiseDealCompleted( )
        {
            _hangingPoints += _currentDeal.HangingPoints;

            if( _hangingPoints != 0 && _currentDeal.HangingPoints == 0 )
            {
                // a previous game was hanging and its time to add the points
                if( _currentDeal.RoundedNorthSouthPoints > _currentDeal.RoundedEastWestPoints )
                {
                    _currentDeal.AddNorthSouthHangingPoints( _hangingPoints );
                }
                else
                {
                    _currentDeal.AddEastWesthHangingPoints( _hangingPoints );
                }

                _hangingPoints = 0;
            }

            _totalNorthSouthPoints += _currentDeal.RoundedNorthSouthPoints;
            _totalEastWestPoints += _currentDeal.RoundedEastWestPoints;

            _southPlayer.CardPlayed -= new Player.CardPlayedHandler( _currentDeal.PlayerPlayedCard );
            _northPlayer.CardPlayed -= new Player.CardPlayedHandler( _currentDeal.PlayerPlayedCard );
            _eastPlayer.CardPlayed -= new Player.CardPlayedHandler( _currentDeal.PlayerPlayedCard );
            _westPlayer.CardPlayed -= new Player.CardPlayedHandler( _currentDeal.PlayerPlayedCard );

            DealCompleted( );

            FinalizeDeal();
        }

Usage Example

Пример #1
0
        private void NextHand()
        {
            if (!_isPaused)
            {
                if (!_playingManager.AreCardsFinished)
                {
                    PlayerHasTurn(_playingManager.GetLastHand().Winner);
                }
                else
                {
                    AddLastTenPoints(_playingManager.GetLastHand().Winner);

                    CountDealPoints();

                    _playingManager.BelotFound -= new Belot.PlayingManager.BelotFoundHandler(AddBelotCombination);
                    _game.RaiseDealCompleted();
                }
            }
        }