mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
fixed a test failure
This commit is contained in:
parent
27b85bca88
commit
5f23ccf24c
3 changed files with 7 additions and 3 deletions
|
@ -84,7 +84,7 @@ class FaithsRewardWatcher extends Watcher {
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
|
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ class FellShepherdWatcher extends Watcher {
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
|
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,17 @@ public class MageObjectReference implements Comparable<MageObjectReference>, Ser
|
||||||
private final int zoneChangeCounter;
|
private final int zoneChangeCounter;
|
||||||
|
|
||||||
public MageObjectReference(MageObject mageObject, Game game) {
|
public MageObjectReference(MageObject mageObject, Game game) {
|
||||||
|
this(mageObject, game, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MageObjectReference(MageObject mageObject, Game game, int offset) {
|
||||||
if (mageObject == null) {
|
if (mageObject == null) {
|
||||||
this.sourceId = null;
|
this.sourceId = null;
|
||||||
this.zoneChangeCounter = -1;
|
this.zoneChangeCounter = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.sourceId = mageObject.getId();
|
this.sourceId = mageObject.getId();
|
||||||
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game);
|
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game) + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue