/// <summary> /// High Card Rank /// </summary> /// <param name="cardsInHand"></param> /// <returns></returns> public static string GetHighCardRank(List <Cards> cardsInHand) { int firstCard = PockerSolvingMethods.GetCardByRank(Convert.ToString(cardsInHand[0].rank)); int secondCard = PockerSolvingMethods.GetCardByRank(Convert.ToString(cardsInHand[1].rank)); if (firstCard > secondCard) { return(Convert.ToString(cardsInHand[0].rank)); } else { return(Convert.ToString(cardsInHand[1].rank)); } }
/// <summary> /// Straight, 2 cards of sequential rank, different suit /// </summary> /// <param name="cardsInHand"></param> /// <returns></returns> public static bool StraightCheck(List <Cards> cardsInHand) { //2 cards of sequential rank, different suit if (!FlushCheck(cardsInHand)) { int firstCard = PockerSolvingMethods.GetCardByRank(Convert.ToString(cardsInHand[0].rank)); int secondCard = PockerSolvingMethods.GetCardByRank(Convert.ToString(cardsInHand[1].rank)); if ((firstCard - secondCard) == 1 || (firstCard - secondCard) == -1) { return(true); } } return(false); }