mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
spjspj - Update SourceHasRemainedInSameZoneCondition with new constructor that passes in game
This commit is contained in:
parent
109506ad63
commit
8c912851dd
1 changed files with 8 additions and 0 deletions
|
@ -49,6 +49,14 @@ public class SourceHasRemainedInSameZoneCondition implements Condition {
|
|||
this.timesChangedZones = -1;
|
||||
}
|
||||
|
||||
public SourceHasRemainedInSameZoneCondition(UUID idToCheck, Game game) {
|
||||
this.idToCheck = idToCheck;
|
||||
this.timesChangedZones = -1;
|
||||
if (this.idToCheck != null && game != null && game.getCard(this.idToCheck) != null) {
|
||||
this.timesChangedZones = game.getState().getZoneChangeCounter(this.idToCheck);
|
||||
}
|
||||
}
|
||||
|
||||
public SourceHasRemainedInSameZoneCondition getInstance(UUID cardId) {
|
||||
return new SourceHasRemainedInSameZoneCondition(cardId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue