public void CardHasBeenDealt(Card a_card)
 {
     m_view.MakeSuperExitingPause();
     m_view.DisplayWelcomeMessage();
     m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore());
     m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore());
 }
示例#2
0
 public void DealCard(Card a_card)
 {
     foreach (IObserver o in m_observers)
     {
         o.cardDrawn(a_card);
     }
     m_hand.Add(a_card);
 }
 public void DealCard(Card a_card)
 {
     foreach (CardAddObserver observer in m_dealObservers)
     {
         observer.CardHasBeenDealt(a_card);
     }
     m_hand.Add(a_card);
 }
示例#4
0
 public void DealCard(Card a_card)
 {
     foreach (CardObserver observer in m_dealObservers)
     {
         observer.CardRedrawn(a_card);
     }
     m_hand.Add(a_card);
 }
示例#5
0
 public void DealCard(Card a_card)
 {
     foreach (var subscriber in m_subscribers)
     {
         subscriber.CardDealt(a_card, this);
     }
     m_hand.Add(a_card);
 }
示例#6
0
 public void DealCard(Card a_card)
 {
     foreach (CardObserver observer in m_subscribers)
     {
         observer.CardDealt(this, a_card);
     }
     m_hand.Add(a_card);
 }
示例#7
0
文件: Player.cs 项目: fh222dt/OOAD
 public void DealCard(Card a_card)
 {
     foreach (ICardObserver observer in m_subscribers)
     {
         observer.cardInHand();
     }
     m_hand.Add(a_card);
 }
示例#8
0
        public void DealCard(Card a_card)
        {
            m_hand.Add(a_card);

            foreach (CardDealtObserver a_observer in m_observers)
            {
                a_observer.CardDealt();
            }
        }
示例#9
0
        public void DealCard(Card a_card)
        {
            m_hand.Add(a_card);

            // Notify observers about new card
            foreach (IBlackJackObserver observer in m_observers)
            {
                observer.GotCard(a_card, this.name);
            }
        }
示例#10
0
文件: Deck.cs 项目: DevRobDev/1DV407
        public Deck()
        {
            m_cards = new List<Card>();
            /* //random cards start */
            for (int colorIx = 0; colorIx < (int)Card.Color.Count; colorIx++)
            {
                for (int valueIx = 0; valueIx < (int)Card.Value.Count; valueIx++)
                {
                    Card c = new Card((Card.Color)colorIx, (Card.Value)valueIx);
                    AddCard(c);
                }
            }
            Shuffle();
            /* //random cards end */

            /* TEST INSTRUCTIONS
             * 1. Comment out random cards code above
             * 2. Change rule in factory
             * 3. Use test code below
             */

            /* //soft hit start
            Card c = new Card((Card.Color)0, (Card.Value)11); //player k
            AddCard(c);
            Card d = new Card((Card.Color)1, (Card.Value)0); //dealer 2
            AddCard(d);
            Card e = new Card((Card.Color)2, (Card.Value)9); //player j
            AddCard(e);
            Card f = new Card((Card.Color)3, (Card.Value)0); //dealer 2
            AddCard(f);
            Card h = new Card((Card.Color)0, (Card.Value)0); //dealer 2
            AddCard(h);
            Card g = new Card((Card.Color)1, (Card.Value)12); //dealer a -> 17 (soft)
            AddCard(g);
            Card i = new Card((Card.Color)1, (Card.Value)10); //dealer q -> 17 (hard)
            AddCard(i);
            Card j = new Card((Card.Color)1, (Card.Value)7); //dealer 9 (never used)
            AddCard(j);
            //soft hit end */

            /* //player advantage start
            Card c = new Card((Card.Color)0, (Card.Value)11); //player k
            AddCard(c);
            Card d = new Card((Card.Color)1, (Card.Value)11); //dealer k
            AddCard(d);
            Card e = new Card((Card.Color)2, (Card.Value)7); //player 9
            AddCard(e);
            Card f = new Card((Card.Color)3, (Card.Value)7); //dealer 9
            AddCard(f);
            Card h = new Card((Card.Color)1, (Card.Value)6); //dealer 8 (never used)
            AddCard(h);
            //player advantage end */          
        }
示例#11
0
        public Deck()
        {
            m_cards = new List<Card>();

            for (int color = 0; color < (int)Card.Color.Count; color++)
            {
                for (int value = 0; value < (int)Card.Value.Count; value++)
                {
                    Card c = new Card((Card.Color)color, (Card.Value)value);
                    Add(c);
                }
            }
        }
示例#12
0
        public Deck()
        {
            m_cards = new List<Card>();

            for (int colorIx = 0; colorIx < (int)Card.Color.Count; colorIx++)
            {
                for (int valueIx = 0; valueIx < (int)Card.Value.Count; valueIx++)
                {
                    Card c = new Card((Card.Color)colorIx, (Card.Value)valueIx);
                    AddCard(c);
                }
            }
            Shuffle();
        }
示例#13
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
     m_observers.ForEach(o => o.NewHandDealt());
 }
示例#14
0
 public void Add(Card a_card)
 {
     m_cards.Add(a_card);
 }
 public void PlayerHandChanged(Player a_player, Card a_card)
 {
     //send the observer call along to observers for this object
     if (m_observers != null)
     {
         foreach (PlayerHandChangedObserver o in m_observers)
         {
             o.PlayerHandChanged(a_player, a_card);
         }
     }
 }
示例#16
0
文件: Deck.cs 项目: fumg/1dv607_2015
 private void Add(Card a_card)
 {
     m_cards.Add(a_card);
 }
示例#17
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
     System.Threading.Thread.Sleep(1000);
     Notify();
 }
示例#18
0
 public void CardDealt(Card card, Player player)
 {
     Thread.Sleep(550);
     if (UserSession.Connection != null)
     {
         GlobalHost.ConnectionManager.GetHubContext<CardDealtHub>().Clients.Client(UserSession.Connection).sendMessage(card.GetColor(), card.GetValue(), player.ToString(), player.CalcScore());
     }
 }
示例#19
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
 }
 public void AddCard(Card a_c)
 {
     m_cards.Add(a_c);
 }
示例#21
0
 public void DealCard(Card a_card)
 {
     Notify(a_card);
     m_hand.Add(a_card);
 }
示例#22
0
 public void Notify(Card card)
 {
     _subscribers.ForEach(s=>s.DealerDealsNewCard(card));
 }
 private void NotifyObserversPlayerHandChanged(Player a_player, Card a_card)
 {
     if (m_observers != null)
     {
         foreach (PlayerHandChangedObserver o in m_observers)
         {
             o.PlayerHandChanged(a_player, a_card);
         }
     }
 }
示例#24
0
 public void Notify(Card card)
 {
     m_observers.ForEach(x => x.HasNewCard());
 }
示例#25
0
 public void cardDraw(Card card)
 {
     Thread.Sleep(500);
     m_view.DisplayCard(card);
 }
示例#26
0
 public void CardDealt(Player player, Card card)
 {
     m_view.Pause(1000);
     ShowGame();
 }
示例#27
0
 public void AddCardToHand(Card a_card)
 {
     m_hand.Add(a_card);
 }