Merge pull request #1895 from spjspj/master

spjspj - Update SourceHasRemainedInSameZoneCondition with new
This commit is contained in:
spjspj 2016-04-22 08:34:10 +10:00
commit 20b1a2ab6b

View file

@ -48,6 +48,14 @@ public class SourceHasRemainedInSameZoneCondition implements Condition {
this.idToCheck = idToCheck;
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);