예제 #1
0
 // 151022 Refactoring of duplication
 public void GetNewCard(bool showCard, Deck deck)
 {
     m_game.notifySubscriber(GetHand(), CalcScore());
     var c = deck.GetCard();
     c.Show(showCard);
     this.DealCard(c);
 }
예제 #2
0
파일: Dealer.cs 프로젝트: ed222gg/1DV607
 public bool NewGame(Player a_player)
 {
     if (m_deck == null || IsGameOver())
     {
         m_deck = new Deck();
         return m_newGameRule.NewGame(this, a_player);
     }
     return false;
 }
예제 #3
0
        public void NewCard(Deck aDeck, Player aPlayer, bool showCard = true)
        {
            Card newCardFromDeck = aDeck.GetCard();
            newCardFromDeck.Show(showCard);
            aPlayer.DealCard(newCardFromDeck);

            foreach (IBlackJackObserver observer in m_observers)
            {
                observer.newCardDelt();
            }
        }
예제 #4
0
        public bool NewGame(Player a_player)
        {
            m_newGameRule.Accept(new view.NewGameRulePrinter());
            m_hitRule.Accept(new view.HitRulePrinter());
            m_winRule.Accept(new view.WinRulePrinter());

            if (m_deck == null || IsGameOver())
            {
                m_deck = new Deck();
                ClearHand();
                a_player.ClearHand();
                return m_newGameRule.NewGame(m_deck, this, a_player);
            }
            return false;
        }
예제 #5
0
        public void Stand()
        {
            if (m_deck != null)
            {
                ShowHand();
                while (GetScoreOfHand() <= 16)
                {
                    Card c = m_deck.GetCard();
                    c.Show();
                    DealCard(c);
                }

                m_deck = null;
            }
        }
예제 #6
0
        public bool NewGame(Player a_player)
        {
            if (m_deck == null || IsGameOver(a_player))
            {
                m_deck = new Deck();

                ClearHand();
                a_player.ClearHand();
                return m_newGameRule.NewGame(m_deck, this, a_player);
            }
            return false;
        }
예제 #7
0
파일: Dealer.cs 프로젝트: fumg/1dv607_2015
 public Dealer()
 {
     m_deck = new Deck();
     m_deck.Shuffle();
 }
예제 #8
0
 public void StartNewRound(Player a_player)
 {
     if (m_deck == null)
     {
         m_deck = new Deck();
         m_startGameRule.StartNewRound(a_player, this, m_deck);
     }
 }
예제 #9
0
 public Dealer(rules.ConcreteRules.RuleFactory a_rules)
 {
     m_deck = null;
     m_startGameRule = a_rules.GetStartNewGameRule();
     //m_startGameRule = new rules.EuroStartNewGameStrategy();
 }