public void Deal(Player a_player, bool show = true) { Card c; c = m_deck.GetCard(); c.Show(show); a_player.DealCard(c); }
public void DealCard(Player a_toGetCard, bool a_showCard) { var c = m_deck.GetCard(); c.Show(a_showCard); a_toGetCard.DealCard(c); Notify(); }
public void DealCard(Player a_player, bool a_show) { Card c; c = m_deck.GetCard(); c.Show(a_show); a_player.DealCard(c); }
public void NewCard(Player a_player, bool show) { Card c = m_deck.GetCard(); c.Show(show); a_player.DealCard(c); UpdateObservers(); }
public void DealCard(bool show, Player a_player) { Card c; c = m_deck.GetCard(); c.Show(show); a_player.DealCard(c); }
public void StartNewRound(Player a_player) { if (m_deck == null) { m_deck = new Deck(); m_startGameRule.StartNewRound(a_player, this, m_deck); } }
public Game(AbstractRulesFactory ruleSet) { rules = new RulesFactory(ruleSet); m_dealer = new Dealer(rules); //m_dealer = new Dealer(new rules.RulesFactory(ruleSet)); m_player = new Player(); PrepareGetRules(); }
public bool IsDealerWinner(Player a_player) { if (m_winRule.DealerWins(a_player.CalcScore(), CalcScore(), m_maxScoreRule.MaxScore())) { return true; } return false; }
public bool IsGameOver(Player a_player) { if (m_deck != null && /*CalcScore() >= g_hitLimit*/ ((m_hitRule.DoHit(this) != true) || a_player.CalcScore() >= 21)) { return true; } return false; }
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 bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < g_maxScore && !IsGameOver(a_player)) { GetAndGiveNewCard(a_player, true); return true; } return false; }
static void Main(string[] args) { model.Dealer d = new model.Dealer(); model.Player p = new model.Player(); view.Console v = new view.Console(); controller.Player c = new controller.Player(); while (c.PlayGame(v, d, p)) ; }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < m_winnerRule.maxScore && !IsGameOver()) { DealCard(true, a_player); return true; } return false; }
public void HitPlayer(Player a_player) { if (m_deck != null && a_player.GetScoreOfHand() < 21) { Card c = m_deck.GetCard(); c.Show(); a_player.DealCard(c); } }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < m_maxScoreRule.MaxScore() && !IsGameOver()) { Deal(a_player, true); return true; } return false; }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < g_maxScore && !IsGameOver()) { DealCardToPlayer(a_player); return true; } return false; }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < g_maxScore && !IsGameOver()) { DrawCardAndShowCard(a_player, true); return true; } return false; }
public void getShowDealCard(Player a_player, Boolean show) { Card c = m_deck.GetCard(); c.Show(show); a_player.DealCard(c); foreach (BlackJackObserver o in m_observers) { o.CardDealt(); } }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < m_winRule.GetMaxScore && !IsGameOver()) { a_player.DealCard(true, m_deck.GetCard()); return true; } return false; }
public void DealPlayerCard(bool hiddenCard, Player player) { Card c = m_deck.GetCard(); c.Show(hiddenCard); player.DealCard(c); foreach (IGameobserver o in m_observer) { o.Playerhasacard(); } }
public void Deal(Player player, bool show) { Card c = m_deck.GetCard(); c.Show(show); player.DealCard(c); foreach (CardDealtListener l in m_subscribers) { l.CardDealt(c); } }
public void GetNewCard(Player a_player, bool a_showCard = true) { foreach (IBlackJackObserver a_observer in m_observers) { a_observer.AddCardDelay(); } Card c = m_deck.GetCard(); c.Show(a_showCard); a_player.DealCard(c); }
public bool Hit(Player a_player) { if (m_deck != null && a_player.CalcScore() < m_winRule.MaxScore && !IsGameOver()) { GetCardAndShow(a_player); return true; } return false; }
public void NewCard(Player a_player, bool a_showCard) { foreach (IGameObserver a_observer in m_observer) { a_observer.CardDelay(); } Card c = m_deck.GetCard(); c.Show(a_showCard); a_player.DealCard(c); }
public void GetCard(Player player, bool showCard = true) { Card c = m_deck.GetCard(); c.Show(showCard); player.DealCard(c); foreach(BlackJackObserver observer in m_BlackJackObserver) { observer.CardDisplayed(); } }
public void Deal(Player person, Boolean value) { Card c = m_deck.GetCard(); c.Show(value); person.DealCard(c); foreach (var observer in m_observer) { observer.cardDrawn(c); } }
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 IsDealerWinner(Player a_player) { if (m_wonRule.IsDealerWinning(this, a_player)) { return true; } else { return false; } }
public void DealCardHandler(bool hiddenCard, Player player) { Card c = m_deck.GetCard(); c.Show(hiddenCard); player.DealCard(c); foreach (IDrawCardObserver o in m_observers) { o.DrawCard(c); } }
// Tar ett kort, sparar, visar upp det. public void DrawCardAndShowCard(Player a_player, bool result) { Card c = m_deck.GetCard(); c.Show(result); a_player.DealCard(c); foreach (var l in m_card) { l.PauseBeforeShowingCard(); } }
static void Main(string[] args) { model.Dealer d = new model.Dealer(new model.rules.RulesFactory(), "Croupier"); model.Player p = new model.Player("Player"); model.Game g = new model.Game(d, p); view.IView v = new view.SwedishView();//new view.SimpleView(); controller.PlayGame ctrl = new controller.PlayGame(v, g); d.Register(ctrl); while (ctrl.Play()) { ; } }