working on the winningProcess method of the Class Game.java
This commit is contained in:
@@ -88,7 +88,6 @@ public class Game {
|
|||||||
|
|
||||||
private void newRound(){
|
private void newRound(){
|
||||||
round++;
|
round++;
|
||||||
System.out.println();
|
|
||||||
System.out.println("----- ROUND " + round + " -----");
|
System.out.println("----- ROUND " + round + " -----");
|
||||||
for (Player p: players) {
|
for (Player p: players) {
|
||||||
p.clearHand();
|
p.clearHand();
|
||||||
@@ -124,9 +123,14 @@ public class Game {
|
|||||||
private void winningProcess(){
|
private void winningProcess(){
|
||||||
int highestCardIndex = -1;
|
int highestCardIndex = -1;
|
||||||
for (int i = 0; i < pickedCards.size(); i++) {
|
for (int i = 0; i < pickedCards.size(); i++) {
|
||||||
|
if (pickedCards.get(i).getCardValue().getIndex() == 14){
|
||||||
|
players.get(i).setTimesWon(players.get(i).getTimesWon()+1);
|
||||||
|
}
|
||||||
|
if (pickedCards.get(i).getCardType().getIndex() == leadingType){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class Player {
|
|||||||
public void displayHand(){
|
public void displayHand(){
|
||||||
System.out.print("Hand: ");
|
System.out.print("Hand: ");
|
||||||
for (int i = 0; i < hand.size(); i++) {
|
for (int i = 0; i < hand.size(); i++) {
|
||||||
System.out.print("(" + (i+1) + ")" + hand.get(i).getName() + "; ");
|
System.out.print("(" + (i+1) + ") " + hand.get(i).getName() + "; ");
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user