Card update was not commited to database
This commit is contained in:
@@ -70,6 +70,12 @@ public class GridManager {
|
|||||||
gRepository.save(g);
|
gRepository.save(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setCardPublic(Card c, char player) {
|
||||||
|
log.debug("Card set public, index {}", c.getIndex());
|
||||||
|
c.setColorPublic(player, true);
|
||||||
|
cRepository.save(c);
|
||||||
|
}
|
||||||
|
|
||||||
private void newHint(Grid g, Hint h) {
|
private void newHint(Grid g, Hint h) {
|
||||||
log.debug("New hint: {}", h);
|
log.debug("New hint: {}", h);
|
||||||
g.incrementHintCount();
|
g.incrementHintCount();
|
||||||
@@ -258,7 +264,7 @@ public class GridManager {
|
|||||||
|
|
||||||
if(c.isColorPublic(other(player)) || (g.getConfig().isOnlyOneGreenGreen() && c.getColor(player) == Card.Color.GREEN && c.isColorPublic(player)))
|
if(c.isColorPublic(other(player)) || (g.getConfig().isOnlyOneGreenGreen() && c.getColor(player) == Card.Color.GREEN && c.isColorPublic(player)))
|
||||||
throw new IllegalGameActionException(g, "Card has already been revealed");
|
throw new IllegalGameActionException(g, "Card has already been revealed");
|
||||||
c.setColorPublic(other(player), true);//TODO XXX BDD
|
setCardPublic(c, other(player));
|
||||||
Card.Color guessedColor = c.getColor(other(player));
|
Card.Color guessedColor = c.getColor(other(player));
|
||||||
|
|
||||||
newGameEvent(g, GameEvent.newGuessEvent(c.getIndex(), player, c.getColor(other(player))));
|
newGameEvent(g, GameEvent.newGuessEvent(c.getIndex(), player, c.getColor(other(player))));
|
||||||
|
|||||||
Reference in New Issue
Block a user