|
@@ -43,8 +43,8 @@ public class Dealer {
|
|
|
|
|
|
card1.onHands = true;
|
|
card1.onHands = true;
|
|
card2.onHands = true;
|
|
card2.onHands = true;
|
|
- players[i].setCards(Player.CARD_SLOT.FIRST, card1);
|
|
|
|
- players[i].setCards(Player.CARD_SLOT.SECOND, card2);
|
|
|
|
|
|
+ players[i].setCards(0, card1);
|
|
|
|
+ players[i].setCards(1, card2);
|
|
}
|
|
}
|
|
currentRateType = RATE_TYPE.FLOP;
|
|
currentRateType = RATE_TYPE.FLOP;
|
|
}
|
|
}
|
|
@@ -92,40 +92,41 @@ public class Dealer {
|
|
|
|
|
|
// ♦♣♥♠
|
|
// ♦♣♥♠
|
|
public void OpeningCard() {
|
|
public void OpeningCard() {
|
|
|
|
+ int slot = 2;
|
|
System.out.println("Карты на столе ");
|
|
System.out.println("Карты на столе ");
|
|
for (Card card : table) {
|
|
for (Card card : table) {
|
|
System.out.print(
|
|
System.out.print(
|
|
deck.CardName.get(card.getDenomination())
|
|
deck.CardName.get(card.getDenomination())
|
|
+ Lear.SYMBOL[card.Lear.ordinal()] + " ");
|
|
+ Lear.SYMBOL[card.Lear.ordinal()] + " ");
|
|
|
|
+
|
|
|
|
+ for (Player p : players) {
|
|
|
|
+ p.setCards(slot, card);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ slot++;
|
|
}
|
|
}
|
|
|
|
+
|
|
System.out.println("\n\nКарты игроков");
|
|
System.out.println("\n\nКарты игроков");
|
|
|
|
|
|
for (Player player : players) {
|
|
for (Player player : players) {
|
|
- Card[] sharedCards = new Card[7];
|
|
|
|
- int i = 0;
|
|
|
|
- for (; i < table.length; i++) {
|
|
|
|
- sharedCards[i] = table[i];
|
|
|
|
- }
|
|
|
|
- sharedCards[i++] = player.getCards(Player.CARD_SLOT.FIRST);
|
|
|
|
- sharedCards[i] = player.getCards(Player.CARD_SLOT.SECOND);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
- Sorting(sharedCards);
|
|
|
|
|
|
+ Sorting(player.cards);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
- PrintCard(sharedCards);
|
|
|
|
|
|
+ PrintCard(player.cards);
|
|
|
|
|
|
- if (!isRoyalFlush(sharedCards, player)) {
|
|
|
|
- if (!isStraightFlush(sharedCards, player)) {
|
|
|
|
- if (!isFourOfAKind(sharedCards, player)) {
|
|
|
|
- if (!isFullHouse(sharedCards, player)) {
|
|
|
|
- if (!isFlush(sharedCards, player)) {
|
|
|
|
- if (!isStraight(sharedCards, player)) {
|
|
|
|
- if (!isThreeOfAKind(sharedCards, player)) {
|
|
|
|
- if (!isTwoPairs(sharedCards, player)) {
|
|
|
|
- if (!isOnePair(sharedCards, player)) {
|
|
|
|
|
|
+ if (!isRoyalFlush(player.cards, player)) {
|
|
|
|
+ if (!isStraightFlush(player.cards, player)) {
|
|
|
|
+ if (!isFourOfAKind(player.cards, player)) {
|
|
|
|
+ if (!isFullHouse(player.cards, player)) {
|
|
|
|
+ if (!isFlush(player.cards, player)) {
|
|
|
|
+ if (!isStraight(player.cards, player)) {
|
|
|
|
+ if (!isThreeOfAKind(player.cards, player)) {
|
|
|
|
+ if (!isTwoPairs(player.cards, player)) {
|
|
|
|
+ if (!isOnePair(player.cards, player)) {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -142,9 +143,15 @@ public class Dealer {
|
|
|
|
|
|
for (int k = 0; k < players.length; k++) {
|
|
for (int k = 0; k < players.length; k++) {
|
|
for (int l = 1; l < players.length; l++) {
|
|
for (int l = 1; l < players.length; l++) {
|
|
|
|
+ if (players[k] == players[l]) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (players[k].combination.Value == players[l].combination.Value) {
|
|
if (players[k].combination.Value == players[l].combination.Value) {
|
|
- for (Card card : sharedCards) {
|
|
|
|
|
|
+ for (int x = 0; x < 7; x++) {
|
|
|
|
+ if (players[k].cards[x].getDenomination() > players[l].cards[x].getDenomination()) {
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|