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());
 }
Beispiel #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);
 }
Beispiel #4
0
 public void DealCard(Card a_card)
 {
     foreach (CardObserver observer in m_dealObservers)
     {
         observer.CardRedrawn(a_card);
     }
     m_hand.Add(a_card);
 }
Beispiel #5
0
 public void DealCard(Card a_card)
 {
     foreach (var subscriber in m_subscribers)
     {
         subscriber.CardDealt(a_card, this);
     }
     m_hand.Add(a_card);
 }
 public void DealCard(Card a_card)
 {
     foreach (CardObserver observer in m_subscribers)
     {
         observer.CardDealt(this, a_card);
     }
     m_hand.Add(a_card);
 }
Beispiel #7
0
 public void DealCard(Card a_card)
 {
     foreach (ICardObserver observer in m_subscribers)
     {
         observer.cardInHand();
     }
     m_hand.Add(a_card);
 }
        public void DealCard(Card a_card)
        {
            m_hand.Add(a_card);

            foreach (CardDealtObserver a_observer in m_observers)
            {
                a_observer.CardDealt();
            }
        }
        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);
            }
        }
Beispiel #10
0
        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 */          
        }
Beispiel #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);
                }
            }
        }
Beispiel #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();
        }
Beispiel #13
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
     m_observers.ForEach(o => o.NewHandDealt());
 }
Beispiel #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);
         }
     }
 }
Beispiel #16
0
 private void Add(Card a_card)
 {
     m_cards.Add(a_card);
 }
Beispiel #17
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
     System.Threading.Thread.Sleep(1000);
     Notify();
 }
 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());
     }
 }
Beispiel #19
0
 public void DealCard(Card a_card)
 {
     m_hand.Add(a_card);
 }
 public void AddCard(Card a_c)
 {
     m_cards.Add(a_c);
 }
Beispiel #21
0
 public void DealCard(Card a_card)
 {
     Notify(a_card);
     m_hand.Add(a_card);
 }
Beispiel #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);
         }
     }
 }
Beispiel #24
0
 public void Notify(Card card)
 {
     m_observers.ForEach(x => x.HasNewCard());
 }
Beispiel #25
0
 public void cardDraw(Card card)
 {
     Thread.Sleep(500);
     m_view.DisplayCard(card);
 }
 public void CardDealt(Player player, Card card)
 {
     m_view.Pause(1000);
     ShowGame();
 }
 public void AddCardToHand(Card a_card)
 {
     m_hand.Add(a_card);
 }