package fivecardstud;
import java.util.ArrayList;
import java.util.List;

public class Hierarchy {
    
    public Hierarchy() {
}

    Card getHighCard(List<Card> cards){
        Card highCard;
        highCard = cards.get(0);
        for (Card card: cards) {
            if (card.value > highCard.value) highCard = card;
        }
        return highCard;
    }
 
    List checkFlush(List<Card> cards){
        String suitTemp;
        suitTemp = cardsBySuit.get(0);
        cardsTemp.add(cards.get(0));
        skipIter = true;
        int i = 0;
        for (String suit: cardsBySuit) {
            // skip first iteration
            if (skipIter == true) {
                skipIter = false;
                continue;
            }
            i++;
            if (suitTemp.equals(suit)) {
                suitTemp = suit;
                cardsTemp.add(cards.get(i));
            }
        }
        return cardsTemp;
    }
    
    boolean checkStrait(){
        skipIter = true;
        valueTemp = cardsByValue.get(0);
        for (int value: cardsByValue) {
            // skip first iteration
            if (skipIter == true) {
                skipIter = false;
                continue;
            }
            valueTemp+=1;
            if (valueTemp == value) {
                valueTemp = value;
            } else {
                return false;
            }
        }
        return true;
    }
    
    
    
    // rank hands from 0 being the worst and up to the best
    public int evaluate(){

        return this.rank;
    }
}

@@ -363,20 +363,23 @@
 %7D%0A %0A    
-List
+boolean
  checkFl
@@ -413,20 +413,14 @@
     
-String suitT
+Card t
 emp;
@@ -424,29 +424,25 @@
 mp;%0A        
-suitT
+t
 emp = cardsB
@@ -440,22 +440,16 @@
  = cards
-BySuit
 .get(0);
@@ -461,118 +461,29 @@
     
-cardsTemp.add(cards.get(0));%0A        skipIter = true;%0A        int i = 0;%0A        for (String suit
+for (Card card
 : cards
-BySuit
 ) %7B%0A
@@ -498,276 +498,72 @@
     
-// skip first iteration%0A            if (skipIter == true) %7B%0A                skipIter = false;%0A                continue;%0A            %7D%0A            i++;%0A            if (suitTemp.equals(suit)) %7B%0A                suitTemp = suit;%0A                cardsTemp.add(cards.get(i))
+if (!card.suit.equals(temp.suit)) %7B%0A                return false
 ;%0A  
@@ -603,17 +603,12 @@
 urn 
-cardsTemp
+true
 ;%0A  
@@ -640,16 +640,32 @@
 kStrait(
+List%3CCard%3E cards
 )%7B%0A     
@@ -1211,16 +1211,32 @@
 valuate(
+List%3CCard%3E cards
 )%7B%0A%0A    

fix Hierarchy.checkFlush