// 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); }
public bool NewGame(Player a_player) { if (m_deck == null || IsGameOver()) { m_deck = new Deck(); return m_newGameRule.NewGame(this, a_player); } return false; }
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(); } }
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; }
public void Stand() { if (m_deck != null) { ShowHand(); while (GetScoreOfHand() <= 16) { Card c = m_deck.GetCard(); c.Show(); DealCard(c); } m_deck = null; } }
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; }
public Dealer() { m_deck = new Deck(); m_deck.Shuffle(); }
public void StartNewRound(Player a_player) { if (m_deck == null) { m_deck = new Deck(); m_startGameRule.StartNewRound(a_player, this, m_deck); } }
public Dealer(rules.ConcreteRules.RuleFactory a_rules) { m_deck = null; m_startGameRule = a_rules.GetStartNewGameRule(); //m_startGameRule = new rules.EuroStartNewGameStrategy(); }