EnterPlayingState() private method

private EnterPlayingState ( ) : void
return void
Beispiel #1
0
        private void NextDeal()
        {
            _southPlayer.Cards.Clear();
            _eastPlayer.Cards.Clear();
            _northPlayer.Cards.Clear();
            _westPlayer.Cards.Clear();

            _currentDeal = new Deal(this, _firstPlayer);

            _firstPlayer = GetNextPlayer(_firstPlayer);
            _deals.Add(_currentDeal);
            _currentDeal.DealFirstCards();

            Player winner = _currentDeal.EnterBiddingState();

            if (_currentDeal.CurrentAnnouncement.Type == AnnouncementTypeEnum.Pass)
            {
                _southPlayer.Cards.Clear();
                _eastPlayer.Cards.Clear();
                _northPlayer.Cards.Clear();
                _westPlayer.Cards.Clear();
                FinalizeDeal();
                return;
            }

            RaiseBiddingCompleted(winner, _currentDeal.CurrentAnnouncement);

            _currentDeal.DealRestCards();

            _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);

            _currentDeal.EnterPlayingState();
        }
Beispiel #2
0
        private void NextDeal()
        {
            _southPlayer.Cards.Clear();
            _eastPlayer.Cards.Clear();
            _northPlayer.Cards.Clear();
            _westPlayer.Cards.Clear();

            _currentDeal = new Deal( this, _firstPlayer );

            _firstPlayer = GetNextPlayer( _firstPlayer );
            _deals.Add( _currentDeal );
            _currentDeal.DealFirstCards();

            Player winner = _currentDeal.EnterBiddingState();
            if( _currentDeal.CurrentAnnouncement.Type == AnnouncementTypeEnum.Pass )
            {
                _southPlayer.Cards.Clear();
                _eastPlayer.Cards.Clear();
                _northPlayer.Cards.Clear();
                _westPlayer.Cards.Clear();
                FinalizeDeal();
                return;
            }

            RaiseBiddingCompleted( winner, _currentDeal.CurrentAnnouncement );

            _currentDeal.DealRestCards();

            _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 );

            _currentDeal.EnterPlayingState();
        }