From 1190ca19c948a3403b1e2f0fad0db9ac90cd13e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kal=C3=A1cska=20Patrik?= Date: Mon, 27 Apr 2015 21:48:55 +0200 Subject: [PATCH] =?UTF-8?q?#17=20A=20k=C3=B3d=20v=C3=A9gleges=C3=ADt=C3=A9?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkPlayers/CheckActivePlayersBets.java | 63 ------- .../org/leanpoker/player/CheckConditions.java | 20 --- .../java/org/leanpoker/player/Player.java | 2 +- .../player/checkCards/CheckDrill.java | 1 - .../player/checkCards/CheckFlush.java | 1 - .../player/checkCards/CheckResult.java | 1 - .../player/checkCards/CheckRiver.java | 2 - .../player/checkCards/CheckStraight.java | 1 - .../player/checkCards/CheckStraightFlush.java | 1 - .../player/checkCards/HandChecker.java | 1 - .../player/strategies/FlopStrategy.java | 59 ------- .../player/strategies/PreFlopStrategy.java | 59 ------- .../player/strategies/RiverStrategy.java | 59 ------- .../leanpoker/player/strategies/Strategy.java | 100 ----------- .../player/strategies/TurnStrategy.java | 59 ------- .../player/CheckActivePlayersBetsTest.java | 67 -------- .../org/leanpoker/player/HandCheckerTest.java | 155 ------------------ 17 files changed, 1 insertion(+), 650 deletions(-) delete mode 100644 src/main/java/com/wcs/poker/player/checkPlayers/CheckActivePlayersBets.java delete mode 100644 src/main/java/org/leanpoker/player/strategies/FlopStrategy.java delete mode 100644 src/main/java/org/leanpoker/player/strategies/PreFlopStrategy.java delete mode 100644 src/main/java/org/leanpoker/player/strategies/RiverStrategy.java delete mode 100644 src/main/java/org/leanpoker/player/strategies/Strategy.java delete mode 100644 src/main/java/org/leanpoker/player/strategies/TurnStrategy.java delete mode 100644 src/test/java/org/leanpoker/player/CheckActivePlayersBetsTest.java delete mode 100644 src/test/java/org/leanpoker/player/HandCheckerTest.java diff --git a/src/main/java/com/wcs/poker/player/checkPlayers/CheckActivePlayersBets.java b/src/main/java/com/wcs/poker/player/checkPlayers/CheckActivePlayersBets.java deleted file mode 100644 index 6cf03f1..0000000 --- a/src/main/java/com/wcs/poker/player/checkPlayers/CheckActivePlayersBets.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.wcs.poker.player.checkPlayers; - -import com.wcs.poker.gamestate.GameState; -import com.wcs.poker.gamestate.Player; -import java.util.ArrayList; -import java.util.List; -import org.leanpoker.player.CheckConditions; - -/** - * - * @author Patrik - */ -public class CheckActivePlayersBets { - - private GameState gState; - private CheckConditions cConditions; - - public CheckActivePlayersBets(GameState gState) { - this.gState = gState; - cConditions=new CheckConditions(gState); - } - - - - - //active játékosok kigyűjtése - public List collectActivePlayers(GameState gameState){ - List activePlayers=new ArrayList<>(); - - for (Player player : gameState.getPlayers()) { - if (player.getStatus().equals("active")) { - activePlayers.add(player); - } - } - - return activePlayers; - } - - //activ játékosok tétjeinek vizsgálata - public int myBetModify(){ - int myBet=0; - boolean thereIs=false; - for (Player p : collectActivePlayers(gState)) { - if (p.getBet()>200) { - thereIs=true; - } - } - - if (thereIs) { - myBet=0; - } - else{ - myBet=cConditions.check(); - } - return myBet; - } - -} diff --git a/src/main/java/org/leanpoker/player/CheckConditions.java b/src/main/java/org/leanpoker/player/CheckConditions.java index f18541b..911e2c9 100644 --- a/src/main/java/org/leanpoker/player/CheckConditions.java +++ b/src/main/java/org/leanpoker/player/CheckConditions.java @@ -9,7 +9,6 @@ import org.leanpoker.player.checkCards.CheckResult; import org.leanpoker.player.checkCards.HandRank; import org.leanpoker.player.checkCards.HandChecker; -import org.leanpoker.player.strategies.*; /** * @@ -34,29 +33,10 @@ public int check() { afterPreFlop(); } -// Strategy strategy = null; -// switch (gameState.getCommunityCards().size()) { -// case 0: -// strategy = new PreFlopStrategy(); -// break; -// case 3: -// strategy = new FlopStrategy(); -// break; -// case 4: -// strategy = new TurnStrategy(); -// break; -// case 5: -// strategy = new RiverStrategy(); -// break; -// } -// if (strategy != null) { -// bet = strategy.calculateBet(gameState); -// } return bet; } private void preFlop() { - //HandChecker handChecker = new HandChecker(); setAllCards(); CheckResult checkResult = new CheckHighCard().getResult(allCards); if (checkResult == null) { diff --git a/src/main/java/org/leanpoker/player/Player.java b/src/main/java/org/leanpoker/player/Player.java index 940c91c..70e6e60 100644 --- a/src/main/java/org/leanpoker/player/Player.java +++ b/src/main/java/org/leanpoker/player/Player.java @@ -4,7 +4,7 @@ public class Player { - static final String VERSION = "Zeusz 1.0"; + static final String VERSION = "Zeusz Final"; public static int betRequest(GameState gameState) { CheckConditions checkConditions = new CheckConditions(gameState); diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckDrill.java b/src/main/java/org/leanpoker/player/checkCards/CheckDrill.java index 2d3ef5f..5a101a8 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckDrill.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckDrill.java @@ -38,7 +38,6 @@ protected void makeOrderedCardList() { for (Card card : cards) { if (card.isEqualRank(highRank1)) { orderedCardList.add(card); - //cards.remove(card); ez sajnos nem jött be (ConcurrentModificationException) } } cards = Tools.orderCards(cards); diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckFlush.java b/src/main/java/org/leanpoker/player/checkCards/CheckFlush.java index 6196439..0146d9d 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckFlush.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckFlush.java @@ -1,7 +1,6 @@ package org.leanpoker.player.checkCards; import com.wcs.poker.gamestate.Card; -import java.util.List; import org.git_egylet.tools.Tools; import static org.leanpoker.player.checkCards.Check.*; diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckResult.java b/src/main/java/org/leanpoker/player/checkCards/CheckResult.java index d02cb63..a5be0c6 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckResult.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckResult.java @@ -2,7 +2,6 @@ import com.wcs.poker.gamestate.Card; import java.util.Collection; -import java.util.Collections; import java.util.List; /** diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckRiver.java b/src/main/java/org/leanpoker/player/checkCards/CheckRiver.java index d254bf5..e8de71e 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckRiver.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckRiver.java @@ -7,8 +7,6 @@ import com.wcs.poker.gamestate.Card; import com.wcs.poker.gamestate.GameState; -import java.util.ArrayList; -import java.util.List; /** * diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckStraight.java b/src/main/java/org/leanpoker/player/checkCards/CheckStraight.java index b8db05d..d035957 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckStraight.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckStraight.java @@ -1,7 +1,6 @@ package org.leanpoker.player.checkCards; import com.wcs.poker.gamestate.Card; -import org.git_egylet.tools.Tools; import static org.leanpoker.player.checkCards.Check.*; /** diff --git a/src/main/java/org/leanpoker/player/checkCards/CheckStraightFlush.java b/src/main/java/org/leanpoker/player/checkCards/CheckStraightFlush.java index d3bdcce..8ba53b1 100644 --- a/src/main/java/org/leanpoker/player/checkCards/CheckStraightFlush.java +++ b/src/main/java/org/leanpoker/player/checkCards/CheckStraightFlush.java @@ -2,7 +2,6 @@ import com.wcs.poker.gamestate.Card; import java.util.Arrays; -import org.git_egylet.tools.Tools; import static org.leanpoker.player.checkCards.Check.*; /** diff --git a/src/main/java/org/leanpoker/player/checkCards/HandChecker.java b/src/main/java/org/leanpoker/player/checkCards/HandChecker.java index 253bf5c..aa7988f 100644 --- a/src/main/java/org/leanpoker/player/checkCards/HandChecker.java +++ b/src/main/java/org/leanpoker/player/checkCards/HandChecker.java @@ -1,7 +1,6 @@ package org.leanpoker.player.checkCards; import com.wcs.poker.gamestate.Card; -import com.wcs.poker.gamestate.GameState; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/org/leanpoker/player/strategies/FlopStrategy.java b/src/main/java/org/leanpoker/player/strategies/FlopStrategy.java deleted file mode 100644 index b9cf1db..0000000 --- a/src/main/java/org/leanpoker/player/strategies/FlopStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.leanpoker.player.strategies; - -/** - * - * @author imate - */ -public class FlopStrategy extends Strategy { - - @Override - protected int calcRoyalFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraightFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcPoker() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcFull() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int callFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraight() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcDrill() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcTwoPair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcOnePair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcHighCard() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} diff --git a/src/main/java/org/leanpoker/player/strategies/PreFlopStrategy.java b/src/main/java/org/leanpoker/player/strategies/PreFlopStrategy.java deleted file mode 100644 index fab614a..0000000 --- a/src/main/java/org/leanpoker/player/strategies/PreFlopStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.leanpoker.player.strategies; - -/** - * - * @author imate - */ -public class PreFlopStrategy extends Strategy { - - @Override - protected int calcRoyalFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraightFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcPoker() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcFull() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int callFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraight() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcDrill() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcTwoPair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcOnePair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcHighCard() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} diff --git a/src/main/java/org/leanpoker/player/strategies/RiverStrategy.java b/src/main/java/org/leanpoker/player/strategies/RiverStrategy.java deleted file mode 100644 index b716196..0000000 --- a/src/main/java/org/leanpoker/player/strategies/RiverStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.leanpoker.player.strategies; - -/** - * - * @author imate - */ -public class RiverStrategy extends Strategy{ - - @Override - protected int calcRoyalFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraightFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcPoker() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcFull() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int callFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraight() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcDrill() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcTwoPair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcOnePair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcHighCard() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} diff --git a/src/main/java/org/leanpoker/player/strategies/Strategy.java b/src/main/java/org/leanpoker/player/strategies/Strategy.java deleted file mode 100644 index 79e915d..0000000 --- a/src/main/java/org/leanpoker/player/strategies/Strategy.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.leanpoker.player.strategies; - -import com.wcs.poker.gamestate.Card; -import com.wcs.poker.gamestate.GameState; -import java.util.List; -import org.leanpoker.player.checkCards.CheckResult; -import org.leanpoker.player.checkCards.HandChecker; -import org.leanpoker.player.checkCards.HandRank; - -/** - * - * @author imate - */ -public abstract class Strategy { - - protected HandRank hand; - protected String highRank1; - protected String highRank2; - protected int myCardsOfHand; - protected List cards; - - public int calculateBet(GameState gameState) { - int bet = 0; - HandChecker handChecker = new HandChecker(); - CheckResult result = handChecker.getResult(cards); - this.hand = result.getHand(); - this.highRank1 = result.getHighRank1(); - this.highRank2 = result.getHighRank2(); - this.myCardsOfHand = result.getMyCardsOfHand(); - - switch (hand) { - case ROYAL_FLUSH: - bet = calcRoyalFlush(); - break; - - case STRAIGH_FLUSH: - bet = calcStraightFlush(); - break; - - case POKER: - bet = calcPoker(); - break; - - case FULL: - bet = calcFull(); - break; - - case FLUSH: - bet = callFlush(); - break; - - case STRAIGHT: - bet = calcStraight(); - break; - - case DRILL: - bet = calcDrill(); - break; - - case TWO_PAIR: - bet = calcTwoPair(); - break; - - case ONE_PAIR: - bet = calcOnePair(); - break; - - case HIGH_CARD: - bet = calcHighCard(); - - } - - return bet; - } - - protected abstract int calcRoyalFlush(); - - protected abstract int calcStraightFlush(); - - protected abstract int calcPoker(); - - protected abstract int calcFull(); - - protected abstract int callFlush(); - - protected abstract int calcStraight(); - - protected abstract int calcDrill(); - - protected abstract int calcTwoPair(); - - protected abstract int calcOnePair(); - - protected abstract int calcHighCard(); -} diff --git a/src/main/java/org/leanpoker/player/strategies/TurnStrategy.java b/src/main/java/org/leanpoker/player/strategies/TurnStrategy.java deleted file mode 100644 index 57c2a2f..0000000 --- a/src/main/java/org/leanpoker/player/strategies/TurnStrategy.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.leanpoker.player.strategies; - -/** - * - * @author imate - */ -public class TurnStrategy extends Strategy{ - - @Override - protected int calcRoyalFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraightFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcPoker() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcFull() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int callFlush() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcStraight() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcDrill() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcTwoPair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcOnePair() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - protected int calcHighCard() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} diff --git a/src/test/java/org/leanpoker/player/CheckActivePlayersBetsTest.java b/src/test/java/org/leanpoker/player/CheckActivePlayersBetsTest.java deleted file mode 100644 index dd52481..0000000 --- a/src/test/java/org/leanpoker/player/CheckActivePlayersBetsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.leanpoker.player; - -import com.wcs.poker.gamestate.GameState; -import com.wcs.poker.player.checkPlayers.CheckActivePlayersBets; -import java.util.Arrays; -import org.git_egylet.tools.Tools; -import org.junit.Test; -import static org.junit.Assert.*; - -/** - * - * @author Patrik - */ -public class CheckActivePlayersBetsTest { - - @Test - public void testCollectActivePlayers(){ - GameState gameState=new GameState(10, 320, 400, 241, 1, 7, 1); - CheckActivePlayersBets bets=new CheckActivePlayersBets(gameState); - com.wcs.poker.gamestate.Player player1 = new com.wcs.poker.gamestate.Player(1, "Albert", "active", "Default random player", 1590, 80); - com.wcs.poker.gamestate.Player player2 = new com.wcs.poker.gamestate.Player(2, "Máté", "active", "Default random player2", 1200, 70); - com.wcs.poker.gamestate.Player player3 = new com.wcs.poker.gamestate.Player(3, "Peti", "out", "Default random player3", 0, 0); - com.wcs.poker.gamestate.Player player4 = new com.wcs.poker.gamestate.Player(4, "Gabi", "active", "Default random player4", 1200, 70); - com.wcs.poker.gamestate.Player player5 = new com.wcs.poker.gamestate.Player(5, "Zsiga", "out", "Default random player5", 0, 0); - com.wcs.poker.gamestate.Player player6 = new com.wcs.poker.gamestate.Player(6, "Thomas", "out", "Default random player6", 0, 0); - - player1.setHoleCards(Tools.makeCardList("A,hearts", "A,clubs")); - player2.setHoleCards(Tools.makeCardList("K,hearts", "4,clubs")); - player3.setHoleCards(Tools.makeCardList("2,hearts", "2,clubs")); - player4.setHoleCards(Tools.makeCardList("3,hearts", "3,clubs")); - player5.setHoleCards(Tools.makeCardList("4,hearts", "4,clubs")); - player6.setHoleCards(Tools.makeCardList("5,hearts", "5,clubs")); - - gameState.setPlayers(Arrays.asList(player1, player2,player3,player4,player5,player6)); - - for (com.wcs.poker.gamestate.Player p : bets.collectActivePlayers(gameState)) { - System.out.println(p.getName()); - } - - } - - @Test - public void testEnemyBets(){ - GameState gameState=new GameState(10, 320, 400, 241, 1, 7, 1); - CheckActivePlayersBets bets=new CheckActivePlayersBets(gameState); - com.wcs.poker.gamestate.Player player1 = new com.wcs.poker.gamestate.Player(1, "Albert", "active", "Default random player", 1590, 500); - com.wcs.poker.gamestate.Player player2 = new com.wcs.poker.gamestate.Player(2, "Máté", "active", "Default random player2", 1200, 70); - com.wcs.poker.gamestate.Player Iam=new com.wcs.poker.gamestate.Player(3, "Iam", "active", "Zeusz 1.0", 1000, 50); - - player1.setHoleCards(Tools.makeCardList("A,hearts", "A,clubs")); - player2.setHoleCards(Tools.makeCardList("K,hearts", "4,clubs")); - Iam.setHoleCards(Tools.makeCardList("2,hearts", "3,clubs")); - - gameState.setPlayers(Arrays.asList(player1, player2,Iam)); - - System.out.println(bets.myBetModify()); - int result=0; - assertTrue(result==bets.myBetModify()); - - } - -} diff --git a/src/test/java/org/leanpoker/player/HandCheckerTest.java b/src/test/java/org/leanpoker/player/HandCheckerTest.java deleted file mode 100644 index 0339c4c..0000000 --- a/src/test/java/org/leanpoker/player/HandCheckerTest.java +++ /dev/null @@ -1,155 +0,0 @@ -//package org.leanpoker.player; -// -//import com.wcs.poker.gamestate.GameState; -//import java.util.Arrays; -//import static org.junit.Assert.*; -//import org.junit.Test; -//import com.wcs.poker.gamestate.Player; -//import org.git_egylet.tools.Tools; -//import org.leanpoker.player.checkCards.CheckResult; -//import org.leanpoker.player.checkCards.HandRank; -//import org.leanpoker.player.checkCards.HandChecker; -// -///** -// * -// * @author imate -// */ -//public class HandCheckerTest { -// -// -// final GameState gameState = new GameState(10, 320, 400, 241, 0, 7, 0); -// Player player1 = new Player(1, "Albert", "active", "Default random player", 1590, 80); -// HandChecker handChecker = new HandChecker(); -// -// @Test -// public void testHighCard() { -// gameState.setCommunityCards(Tools.makeCardList("2,hearts", "3,clubs", "Q,diamonds", "6,spades", "7,diamonds")); -// player1.setHoleCards(Tools.makeCardList("4,hearts", "J,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.HIGH_CARD); -// assertEquals(result.getHighRank1(), "Q"); -// assertEquals(result.getHighRank2(), "J"); -// } -// -// @Test -// public void testOnePair() { -// gameState.setCommunityCards(Tools.makeCardList("2,hearts", "3,clubs", "4,diamonds", "6,spades", "7,diamonds")); -// player1.setHoleCards(Tools.makeCardList("4,hearts", "A,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.ONE_PAIR); -// assertEquals(result.getHighRank1(), "4"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 1); -// } -// -// @Test -// public void testTwoPair() { -// gameState.setCommunityCards(Tools.makeCardList("2,hearts", "3,clubs", "4,diamonds", "6,spades", "7,diamonds")); -// player1.setHoleCards(Tools.makeCardList("2,hearts", "6,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.TWO_PAIR); -// assertEquals(result.getHighRank1(), "6"); -// assertEquals(result.getHighRank2(), "2"); -// assertEquals(result.getMyCardsOfHand(), 2); -// -// } -// -// @Test -// public void testDrill() { -// gameState.setCommunityCards(Tools.makeCardList("J,hearts", "3,clubs", "3,diamonds", "3,spades", "7,diamonds")); -// player1.setHoleCards(Tools.makeCardList("J,hearts", "J,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.DRILL); -// assertEquals(result.getHighRank1(), "J"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 2); -// } -// -// @Test -// public void testStraight() { -// gameState.setCommunityCards(Tools.makeCardList("6,hearts", "7,clubs", "8,diamonds", "9,spades", "A,diamonds")); -// player1.setHoleCards(Tools.makeCardList("4,hearts", "5,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.STRAIGHT); -// assertEquals(result.getHighRank1(), "9"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 1); -// } -// -// @Test -// public void testFlush() { -// gameState.setCommunityCards(Tools.makeCardList("10,hearts", "5,hearts", "3,hearts", "4,spades", "7,hearts")); -// player1.setHoleCards(Tools.makeCardList("J,hearts", "J,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.FLUSH); -// assertEquals(result.getHighRank1(), "J"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 1); -// } -// -// @Test -// public void testFull() { -// gameState.setCommunityCards(Tools.makeCardList("J,spades", "5,diamonds", "5,hearts", "J,spades", "7,hearts")); -// player1.setHoleCards(Tools.makeCardList("J,hearts", "4,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.FULL); -// assertEquals(result.getHighRank1(), "J"); -// assertEquals(result.getHighRank2(), "5"); -// assertEquals(result.getMyCardsOfHand(), 1); -// -// } -// -// @Test -// public void testPoker() { -// gameState.setCommunityCards(Tools.makeCardList("8,spades", "8,diamonds", "5,hearts", "4,spades", "7,hearts")); -// player1.setHoleCards(Tools.makeCardList("8,hearts", "8,clubs")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.POKER); -// assertEquals(result.getHighRank1(), "8"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 2); -// } -// -// @Test -// public void testStraightFlush() { -// gameState.setCommunityCards(Tools.makeCardList("3,hearts", "4,hearts", "5,hearts", "J,diamonds", "3,diamonds")); -// player1.setHoleCards(Tools.makeCardList("6,hearts", "7,hearts")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.STRAIGH_FLUSH); -// assertEquals(result.getHighRank1(), "7"); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 2); -// } -// -// @Test -// public void testRoyalFlush() { -// gameState.setCommunityCards(Tools.makeCardList("Q,hearts", "K,hearts", "10,hearts", "J,hearts", "3,diamonds")); -// player1.setHoleCards(Tools.makeCardList("J,spades", "A,hearts")); -// gameState.setPlayers(Arrays.asList(player1)); -// -// CheckResult result = handChecker.getResult(gameState); -// assertEquals(result.getHand(), HandRank.ROYAL_FLUSH); -// assertEquals(result.getHighRank1(), ""); -// assertEquals(result.getHighRank2(), ""); -// assertEquals(result.getMyCardsOfHand(), 1); -// } -// -//}