Package com.poker.analyst.analyser.combanalyzer

Source Code of com.poker.analyst.analyser.combanalyzer.HighCardAnalyzer

package com.poker.analyst.analyser.combanalyzer;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.poker.analyst.analyser.CardComparator;
import com.poker.analyst.combination.HighCard;
import com.poker.analyst.combination.Pair;
import com.poker.analyst.element.Card;
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);
   
    return analyseHighCards(allCards, plCards);
  }
  public static List<HighCard> analyseHighCards(Set<Card> allCards, PlayingCards plCards){
    HighCard      high    = null;
    List<HighCard>     highList   = new ArrayList<HighCard>()
    List<Card>       cardList  = new ArrayList<Card>();
   
    int i = 0;
    for (Card card: allCards){
      if (i++>=5) break;
      cardList.add(card);
    }
    high = new HighCard();
    high.setCombinationList(cardList);
    highList.add(high);
       
    return highList;
  }
}
TOP

Related Classes of com.poker.analyst.analyser.combanalyzer.HighCardAnalyzer

TOP
Copyright © 2018 www.massapi.com. 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.