mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Prevent having the same cards revealed multiple times
This commit is contained in:
@@ -7,10 +7,11 @@ import forge.game.zone.ZoneType;
|
|||||||
|
|
||||||
//Stores information to reveal cards after a delay unless those cards can be revealed in the same dialog as cards being selected
|
//Stores information to reveal cards after a delay unless those cards can be revealed in the same dialog as cards being selected
|
||||||
public class DelayedReveal {
|
public class DelayedReveal {
|
||||||
public final Collection<Card> cards;
|
private final Collection<Card> cards;
|
||||||
public final ZoneType zone;
|
private final ZoneType zone;
|
||||||
public final Player owner;
|
private final Player owner;
|
||||||
public final String messagePrefix;
|
private final String messagePrefix;
|
||||||
|
private boolean revealed;
|
||||||
|
|
||||||
public DelayedReveal(Collection<Card> cards0, ZoneType zone0, Player owner0) {
|
public DelayedReveal(Collection<Card> cards0, ZoneType zone0, Player owner0) {
|
||||||
this(cards0, zone0, owner0, null);
|
this(cards0, zone0, owner0, null);
|
||||||
@@ -23,6 +24,8 @@ public class DelayedReveal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reveal(PlayerController controller) {
|
public void reveal(PlayerController controller) {
|
||||||
|
if (revealed) { return; } //avoid revealing more than once
|
||||||
|
revealed = true;
|
||||||
controller.reveal(cards, zone, owner, messagePrefix);
|
controller.reveal(cards, zone, owner, messagePrefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user