public bool GetGameWinnerRule(model.Player a_dealer, model.Player a_player) { if (a_dealer.CalcScore() > g_maxScore && a_player.CalcScore() > g_maxScore && a_dealer.CalcScore() < a_player.CalcScore()) { return(false); } else if (a_dealer.CalcScore() > g_maxScore && a_player.CalcScore() > g_maxScore && a_dealer.CalcScore() > a_player.CalcScore()) { return(true); } else if (a_dealer.CalcScore() <= g_maxScore && a_player.CalcScore() > g_maxScore) { return(true); } else if (a_dealer.CalcScore() > g_maxScore && a_player.CalcScore() <= g_maxScore) { return(false); } else if (a_dealer.CalcScore() <= g_maxScore && a_player.CalcScore() <= g_maxScore && a_dealer.CalcScore() > a_player.CalcScore()) { return(true); } else { return(false); } }
public bool DoHit(model.Player a_dealer) { // Om äss, och summan av handen är 17 bool isSoft17 = a_dealer.CalcScore() == 17 && a_dealer.GetHand().Any(card => card.GetValue() == Card.Value.Ace); return(isSoft17 || a_dealer.CalcScore() < 17); }
public bool EasyWinningRule(model.Player a_dealer, model.Player a_player) { if (a_dealer.CalcScore() == a_player.CalcScore()) { return(false); } if (a_dealer.CalcScore() > a_player.CalcScore() && a_dealer.CalcScore() < 21) { return(true); } if (a_dealer.CalcScore() > g_maxScore) { return(false); } else if (a_dealer.CalcScore() == 21) { return(true); } if (a_player.CalcScore() > g_maxScore) { return(true); } else if (a_player.CalcScore() == 21) { return(false); } return(false); }
public bool DoHit(model.Player a_dealer) { // This rule presumes limit of cards is 5 bool isUnderLimit = a_dealer.CalcScore() < g_hitLimit; bool isSoft17 = a_dealer.CalcScore() == g_hitLimit && a_dealer.HasAce(); return(isUnderLimit || isSoft17); }
public bool DoHit(model.Player a_dealer, model.Player a_player) { if (a_dealer.CalcScore() > a_player.CalcScore()) { return(false); } return(a_dealer.CalcScore() < g_hitLimit || a_dealer.CalcScore() < a_player.CalcScore()); }
public bool DoHit(model.Player a_dealer) { if (a_dealer.CalcScore() == 17 && a_dealer.hasAce()) { return(true); } return(a_dealer.CalcScore() < g_hitLimit); }
public bool DoHit(model.Player a_dealer) { if (a_dealer.CalcScore() == SoftHitLimit && HasAnAce(a_dealer)) { return(true); } return(a_dealer.CalcScore() < SoftHitLimit); }
public bool DoHit(model.Player a_dealer) { foreach (Card c in a_dealer.GetHand()) { if (c.GetValue() == Card.Value.Ace && a_dealer.CalcScore() == g_hitLimit) { return(true); } } return(a_dealer.CalcScore() < g_hitLimit); }
public bool DoCheckWinner(model.Dealer a_dealer, model.Player a_player) { if (a_dealer.CalcScore() == a_player.CalcScore()) { return(true); } else { return(a_dealer.CalcScore() > a_player.CalcScore()); } }
public bool IsDealerWinner(model.Player a_dealer, model.Player a_player) { if (a_player.CalcScore() > g_maxScore) { return(true); } else if (a_dealer.CalcScore() > g_maxScore) { return(false); } return(a_dealer.CalcScore() >= a_player.CalcScore()); }
public bool DidWin(model.Player playerOne, model.Player playerTwo, int maxScore) { if (playerTwo.CalcScore() > maxScore) { return(true); } else if (playerOne.CalcScore() > maxScore) { return(false); } return(playerOne.CalcScore() >= playerTwo.CalcScore()); }
public bool DoHit(model.Player a_dealer) { if (a_dealer.CalcScore() < g_hitLimit) { return(true); } if (a_dealer.CalcScore() == g_hitLimit) { return(a_dealer.GetHand().Any(c => c.GetValue() == Card.Value.Ace)); } return(false); }
public bool DoHit(model.Player a_dealer) { List <Card> list = (List <Card>)a_dealer.GetHand(); if (a_dealer.CalcScore() == g_hitLimit) { return(list.Exists(x => x.GetValue() == Card.Value.Ace)); } else { return(a_dealer.CalcScore() < g_hitLimit); } }
public bool DoHit(model.Player a_dealer) { IEnumerable <Card> cards = a_dealer.GetHand(); foreach (Card card in cards) { if (card.GetValue() == Card.Value.Ace && a_dealer.CalcScore() == g_hitLimit) { return(true); } } return(a_dealer.CalcScore() < g_hitLimit); }
public Boolean IsDealerWinner(model.Dealer a_dealer, model.Player a_player) { int maxScore = a_dealer.getMaxScore(); if (a_player.CalcScore() > maxScore) { return(true); } else if (a_dealer.CalcScore() > maxScore) { return(false); } return(a_dealer.CalcScore() > a_player.CalcScore()); }
public bool DoHit(model.Player a_dealer, model.Player a_player) { if (a_dealer.CalcScore() > a_player.CalcScore()) { return(false); } if (a_dealer.CalcScore() < g_softHitLimit && isSoftHand(a_dealer)) { return(true); } else { return(a_dealer.CalcScore() < g_hitLimit || a_dealer.CalcScore() < a_player.CalcScore()); } }
public bool DoHit(model.Player a_dealer) { // Added code. if (a_dealer.CalcScore() == g_hitLimit && a_dealer.IsSoftSeventeen()) { return(true); } else if (a_dealer.CalcScore() < g_hitLimit) { return(true); } else { return(false); } }
public bool IsDealerWinner(model.Player a_dealer, model.Player a_player) { if (a_player.CalcScore() > g_maxScore) { return(true); } else if (a_dealer.CalcScore() > g_maxScore) { return(false); } else if (a_dealer.CalcScore() > a_player.CalcScore()) { return(true); } return(false); //if dealer and player have the same score }
public bool isDealerWinner(model.Player a_dealer, model.Player a_player, int maxScore) { if (a_player.CalcScore() > maxScore) { return(true); } else if (a_dealer.CalcScore() > maxScore) { return(false); } else if (a_dealer.CalcScore() == a_player.CalcScore()) // Same score, player wins { return(false); } return(a_dealer.CalcScore() > a_player.CalcScore()); }
public bool CheckDealerWon(model.Player a_dealer, model.Player a_player, int g_maxScore) { if (a_player.CalcScore() > g_maxScore) { return(true); } if (a_dealer.CalcScore() > g_maxScore) { return(false); } if (a_dealer.CalcScore() > a_player.CalcScore()) { return(true); } return(false); }
public bool DoHit(model.Player a_dealer) { int dealerScoreAceLowered = a_dealer.CalcScore(); int dealerScoreAceNotLowered = 0; int[] cardScores = new int[(int)model.Card.Value.Count] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11 }; foreach (Card c in a_dealer.GetHand()) { if (c.GetValue() != Card.Value.Hidden) { dealerScoreAceNotLowered += cardScores[(int)c.GetValue()]; } if (dealerScoreAceNotLowered == 17 && c.GetValue() == Card.Value.Ace) { return(dealerScoreAceNotLowered < g_softHitLimit); } } return(dealerScoreAceLowered < g_hardHitLimit); }
public bool DoHit(model.Player a_dealer) { IEnumerable <Card> hand = a_dealer.GetHand(); if (a_dealer.CalcScore() == 17) { foreach (var card in hand) { if (card.GetValue() == Card.Value.Ace) { return(true); } } } return(a_dealer.CalcScore() < g_hitLimit); }
public bool DoHit(model.Player a_dealer) { int score = a_dealer.CalcScore(); if (score < g_hitLimit) { return(true); } if (score == g_hitLimit) { foreach (Card c in a_dealer.GetHand()) { //If Ace is in the hand, checks if score without Ace is 6 if ((c.GetValue() == Card.Value.Ace) && (score - 11 == 6)) { score -= 10; } } return(score < g_hitLimit); } return(false); }
public void RedrawAndShowHand(model.Dealer a_dealer, model.Player a_player) { System.Threading.Thread.Sleep(2000); DisplayWelcomeMessage(); DisplayDealerHand(a_dealer.GetHand(), a_dealer.CalcScore()); DisplayPlayerHand(a_player.GetHand(), a_player.CalcScore()); }
// return true if score is 17 and dealer has an Ace, // else return true/false depending on if dealer has // a score lower than the hit limit. public bool DoHit(model.Player a_dealer) { IEnumerable <Card> cards = a_dealer.GetHand(); if (a_dealer.CalcScore() == g_hitLimit) { foreach (var c in cards) { if (c.GetValue() == Card.Value.Ace) { return(false); } } } return(a_dealer.CalcScore() < g_hitLimit); }
public bool DoHit(model.Player a_dealer) { if (a_dealer.CalcCardValues() == g_softLimit && a_dealer.FoundAce()) { return(true); } return(a_dealer.CalcScore() < g_softLimit); }
//Hit if score is 17 or less public bool DoHit(model.Player a_dealer) { var cards = a_dealer.GetHand(); if (a_dealer.CalcScore() == g_hitLimit) { foreach (Card card in cards) { if (card.GetValue() == Card.Value.Ace && a_dealer.CalcScore() - 11 == 6) { return(true); } } } return(a_dealer.CalcScore() < g_hitLimit); }
public bool DoHit(model.Player a_dealer) { int score = a_dealer.CalcScore(false); // parameter false means don't calcScore using Ace as 1 but only 11 if (score == g_hitLimit) { foreach (Card c in a_dealer.GetHand()) { if (c.GetValue() == Card.Value.Ace) { return(true); } } } return(a_dealer.CalcScore() < g_hitLimit); }
public bool IsWinner(int g_maxScore, model.Player a_dealer, model.Player a_player) { if (a_player.CalcScore() > g_maxScore) { return(true); } else if (a_dealer.CalcScore() > g_maxScore) { return(false); } if (a_player.CalcScore() >= a_dealer.CalcScore()) { return(false); } else { return(true); } }
public bool DoHit(model.Player a_dealer) { if (a_dealer.CalcScore() < g_hitLimit || a_dealer.GotSoftSeventeen()) { return(true); } else { return(false); } }