package poker

import poker.domain._
import poker.domain.Valor._
import poker.domain.Naipe._

object PokerHelperTest {
  
  def c(tuplas:Tuple2[Int, Int]*): Combinacao = {
    var list = List[Carta]()
    tuplas.foreach { tupla:Tuple2[Int, Int] =>
      list = list + new Carta(tupla._1, tupla._2)
    }
    var comb = CombinacaoFactory.get(list)
//    var comb = new Combinacao(list)
    comb
  }
  
  def menorCartaMaisAlta(): Combinacao = {
    c((2, PAUS), (3, PAUS), (4, PAUS), (5, PAUS), (7, COPAS))
  }
  
  def maiorCartaMaisAlta(): Combinacao = {
    c((9, PAUS), (J, PAUS), (Q, PAUS), (K, PAUS), (AS, COPAS))
  }
  
  def menorPar(): Combinacao = {
    c((2, PAUS), (2, COPAS), (3, PAUS), (4, PAUS), (5, PAUS))
  }
  
  def maiorPar(): Combinacao = {
    c((AS, PAUS), (AS, COPAS), (K, PAUS), (Q, PAUS), (J, PAUS))
  }
  
  def menorDoisPares(): Combinacao = {
    c((2, PAUS), (2, COPAS), (3, PAUS), (3, COPAS), (4, PAUS))
  }
  
  def maiorDoisPares(): Combinacao = {
    c((AS, PAUS), (AS, COPAS), (K, PAUS), (K, COPAS), (Q, PAUS))
  }
  
  def menorTrinca(): Combinacao = {
    c((2, PAUS), (2, COPAS), (2, ESPADAS), (3, PAUS), (4, COPAS))
  }
  
  def maiorTrinca(): Combinacao = {
    c((AS, PAUS), (AS, COPAS), (AS, ESPADAS), (K, PAUS), (Q, COPAS))
  }
  
  def menorSequencia(): Combinacao = {
   c((2, PAUS), (3, COPAS), (4, ESPADAS), (5, OUROS), (6, PAUS)) 
  }
  
  def maiorSequencia(): Combinacao = {
   c((AS, PAUS), (K, COPAS), (Q, ESPADAS), (J, OUROS), (10, PAUS)) 
  }
  
  def sequenciaComAS2(): Combinacao = {
   c((AS, PAUS), (2, COPAS), (3, ESPADAS), (4, OUROS), (5, PAUS)) 
  }
  
  def menorFullHouse(): Combinacao = {
    c((2, PAUS), (2, COPAS), (2, ESPADAS), (3, PAUS), (3, COPAS))
  }
  
  def maiorFullHouse(): Combinacao = {
    c((AS, PAUS), (AS, COPAS), (AS, ESPADAS), (K, PAUS), (K, COPAS))
  }
  
  def menorFlush(): Combinacao = {
    c((2, OUROS), (3, OUROS), (4, OUROS), (5, OUROS), (7, OUROS))
  }
  
  def maiorFlush(): Combinacao = {
    c((AS, OUROS), (K, OUROS), (Q, OUROS), (J, OUROS), (9, OUROS))
  }
  
  def menorQuadra(): Combinacao = {
    c((2, PAUS), (2, COPAS), (2, ESPADAS), (2, OUROS), (3, PAUS))
  }
  
  def maiorQuadra(): Combinacao = {
    c((AS, PAUS), (AS, COPAS), (AS, ESPADAS), (AS, OUROS), (K, PAUS))
  }
  
  def menorSequenciaFlush(): Combinacao = {
   c((2, PAUS), (3, PAUS), (4, PAUS), (5, PAUS), (6, PAUS)) 
  }
  
  def maiorSequenciaFlush(): Combinacao = {
   c((AS, PAUS), (K, PAUS), (Q, PAUS), (J, PAUS), (10, PAUS)) 
  }
  

//  def c(tuplas:Tuple2[Int, Int]*): Combinacao = {
//    var comb = new Combinacao()
//    tuplas.foreach { tupla:Tuple2[Int, Int] =>
//	    comb.push(new Carta(tupla._1, tupla._2))
//    }
//    comb
//  }

  def criaMao(tuplas:Tuple2[Int, Int]*): Mao = {
    var mao = new Mao()
    tuplas.foreach { tupla:Tuple2[Int, Int] =>
	    mao.push(new Carta(tupla._1, tupla._2))
    }
    mao
  }
  
  def criaMesa(tuplas:Tuple2[Int, Int]*): Mesa = {
    var mesa = new Mesa()
    tuplas.foreach { tupla:Tuple2[Int, Int] =>
      mesa.push(new Carta(tupla._1, tupla._2))
    }
    mesa
  }
  
}
