Package com.poker.analyst.analyser

Examples of com.poker.analyst.analyser.CardComparator


import com.poker.analyst.element.PlayingCards;
import com.poker.analyst.element.Suit;

public class SmthOfKing {
  public static List<ThreeOfKind> analyse3OfKing(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here


      if (card != null) allCards.add(card);
   
    return analyse3OfKing(allCards, plCards);
  }
  public static List<FourOfKind> analyse4OfKing(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here

import com.poker.analyst.element.CardFace;
import com.poker.analyst.element.PlayingCards;

public class PairAnalyzer {
  public static List<Pair> analysePair(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here

      combination instanceof ThreeOfKind ||
      combination instanceof FourOfKind  ||
      combination instanceof FourOfKind  ||
      combination instanceof FullHouse     ){
                 
      Set<Card> allCards = new TreeSet<Card>(new CardComparator());
      for (Card card: plCards.getPlayerCards())
        if (card != null) allCards.add(new Card(Suit.forAnalyse,card.getFace()));
      for (Card card: plCards.getTableCards())
        if (card != null) allCards.add(new Card(Suit.forAnalyse,card.getFace()));
     
View Full Code Here

public class StraightAnalyzer {
  public static List<Straight> analyseStraight(PlayingCards plCards,
      List<Pair> pairs,
      List<ThreeOfKind> threeOfKinds,
      List<FourOfKind> fourOfKinds){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
View Full Code Here

  }
  public static List<Straight> analyseStraightOESD(PlayingCards plCards,
      List<Pair> pairs,
      List<ThreeOfKind> threeOfKinds,
      List<FourOfKind> fourOfKinds){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
View Full Code Here

      for (Combination repeatedComb: fourOfKinds)
        repeatedCards.add(repeatedComb.getMaxValue())

    allStraightCardLists = new ArrayList<Set<Card>>();   

    Set<Card> allNonRepCards = new TreeSet<Card>(new CardComparator());
    CardFace previousCard = null;

    for (Card card: allCards){
      if (card.getFace().equals(previousCard))
        continue;
      else
        previousCard = card.getFace();
     
      allNonRepCards.add(card);
    }
   
    int i = 0;
    int count = 0;
    int previous = 100;
    int position = -1;
   
    List<Integer> positions = new ArrayList<Integer>();
    do{
      i = 0;
      for (Card card: allNonRepCards){
        i++;
        if (position >= i ) continue;
        if (card.getFace().getSerialNumber() == previous - 1){
          previous--;
          count++;
        }
        else{
          previous = card.getFace().getSerialNumber();
          position = i;
          count = 1;   
        }
 
        if (count == numCards){
          positions.add(position);
          break;
        }       
      }
    }while(count == numCards);
   
    for (Integer pos: positions){
      i = 0;
      straightCardList = new TreeSet<Card>(new CardComparator());
      for (Card card: allNonRepCards){
        if (++i < pos) continue;
        if (card.getFace().equals(CardFace.ACE) && numCards == 4){
          straightCardList = null;
          break;
View Full Code Here

import com.poker.analyst.element.CardFace;
import com.poker.analyst.element.PlayingCards;

public class HighCardAnalyzer {
  public static List<HighCard> analyseHighCards(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here



public class FlushAnalyzer {
  public static List<Flush> analyseFlush(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here

      if (card != null) allCards.add(card);
   
    return analyseFlush(allCards, plCards);
  }
  public static List<Flush> analyseFlushDraw(PlayingCards plCards){
    Set<Card> allCards = new TreeSet<Card>(new CardComparator());
    for (Card card: plCards.getPlayerCards())
      if (card != null) allCards.add(card);
    for (Card card: plCards.getTableCards())
      if (card != null) allCards.add(card);
   
View Full Code Here

TOP

Related Classes of com.poker.analyst.analyser.CardComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.