mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-07-09 05:17:45 +00:00
fix: devweb - Correction of comparison between gameCard and playerCard.
This commit is contained in:
@@ -105,7 +105,7 @@ public class GameWS {
|
|||||||
|
|
||||||
int playerScore = player.getScore();
|
int playerScore = player.getScore();
|
||||||
Card gameCard = game.getDeck().getCards().get(game.getCurrentRound());
|
Card gameCard = game.getDeck().getCards().get(game.getCurrentRound());
|
||||||
Card playerCard = player.getDeck().getCards().get(game.getCurrentRound());
|
Card playerCard = player.getDeck().getCards().get((player.getPartialRightClickCount()+player.getRightClickCount()) % player.getDeck().getCards().size());
|
||||||
|
|
||||||
player.setCurrentClick(choice);
|
player.setCurrentClick(choice);
|
||||||
|
|
||||||
@@ -136,23 +136,18 @@ public class GameWS {
|
|||||||
player.incrementRightClickCount();
|
player.incrementRightClickCount();
|
||||||
player.setScore(playerScore + 2);
|
player.setScore(playerScore + 2);
|
||||||
} else {
|
} else {
|
||||||
if (isRapid) {
|
|
||||||
player.incrementRapidClickCount();
|
|
||||||
playerScore++;
|
|
||||||
}
|
|
||||||
player.setScore(playerScore - 1);
|
player.setScore(playerScore - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case COLOR -> {
|
case COLOR -> {
|
||||||
if (gameCard.getColor().equals(playerCard.getColor())) {
|
if (gameCard.getColor().equals(playerCard.getColor())) {
|
||||||
if (gameCard.getValue() != playerCard.getValue()) {
|
if (!gameCard.equals(playerCard)) {
|
||||||
if (isRapid) {
|
if (isRapid) {
|
||||||
player.incrementRapidClickCount();
|
player.incrementRapidClickCount();
|
||||||
playerScore++;
|
playerScore++;
|
||||||
}
|
}
|
||||||
player.incrementRightClickCount();
|
player.incrementRightClickCount();
|
||||||
player.setScore(playerScore + 2);
|
player.setScore(playerScore + 2);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
player.incrementPartialRightClickCount();
|
player.incrementPartialRightClickCount();
|
||||||
player.setScore(playerScore + 1);
|
player.setScore(playerScore + 1);
|
||||||
@@ -163,7 +158,7 @@ public class GameWS {
|
|||||||
}
|
}
|
||||||
case VALUE -> {
|
case VALUE -> {
|
||||||
if (gameCard.getValue() == playerCard.getValue()) {
|
if (gameCard.getValue() == playerCard.getValue()) {
|
||||||
if (!gameCard.getColor().equals(playerCard.getColor())) {
|
if (!gameCard.equals(playerCard)) {
|
||||||
if (isRapid) {
|
if (isRapid) {
|
||||||
player.incrementRapidClickCount();
|
player.incrementRapidClickCount();
|
||||||
playerScore++;
|
playerScore++;
|
||||||
@@ -207,7 +202,6 @@ public class GameWS {
|
|||||||
player.incrementRightClickCount();
|
player.incrementRightClickCount();
|
||||||
player.setScore(playerScore + 2);
|
player.setScore(playerScore + 2);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
player.setScore(playerScore - 1);
|
player.setScore(playerScore - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export default class PlayerHand {
|
|||||||
<div class="pb-1 pt-1">
|
<div class="pb-1 pt-1">
|
||||||
<p class="has-text-centered has-text-white title is-4 mb-1">${this.player.user.username}</p>
|
<p class="has-text-centered has-text-white title is-4 mb-1">${this.player.user.username}</p>
|
||||||
<p class="has-text-centered has-text-white title is-5">${this.player.score}</p>
|
<p class="has-text-centered has-text-white title is-5">${this.player.score}</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -29,6 +28,5 @@ export default class PlayerHand {
|
|||||||
${textPosition === PlayerHand.TextPosition.BOTTOM ? text : ""}
|
${textPosition === PlayerHand.TextPosition.BOTTOM ? text : ""}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user