mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Revert TriggerHandler to r28873; accidentally committed some experimental code that evidently wasn't working.
This commit is contained in:
@@ -145,22 +145,17 @@ public class TriggerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Trigger parseTrigger(final Map<String, String> mapParams, final Card host, final boolean intrinsic) {
|
public static Trigger parseTrigger(final Map<String, String> mapParams, final Card host, final boolean intrinsic) {
|
||||||
final TriggerType type = TriggerType.smartValueOf(mapParams.get("Mode"));
|
Trigger ret = null;
|
||||||
final Trigger ret = type.createTrigger(mapParams, host, intrinsic);
|
|
||||||
|
|
||||||
final String triggerZones = mapParams.get("TriggerZones");
|
final TriggerType type = TriggerType.smartValueOf(mapParams.get("Mode"));
|
||||||
|
ret = type.createTrigger(mapParams, host, intrinsic);
|
||||||
|
|
||||||
|
String triggerZones = mapParams.get("TriggerZones");
|
||||||
if (null != triggerZones) {
|
if (null != triggerZones) {
|
||||||
ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(triggerZones)));
|
ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(triggerZones)));
|
||||||
} else if (type == TriggerType.ChangesZone) {
|
|
||||||
// Special case, because ChangesZone triggers on cards don't
|
|
||||||
// specify their TriggerZone
|
|
||||||
final String origin = mapParams.get("Destination");
|
|
||||||
if (!"Any".equals(origin)) {
|
|
||||||
ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(origin)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String triggerPhases = mapParams.get("Phase");
|
String triggerPhases = mapParams.get("Phase");
|
||||||
if (null != triggerPhases) {
|
if (null != triggerPhases) {
|
||||||
ret.setTriggerPhases(PhaseType.parseRange(triggerPhases));
|
ret.setTriggerPhases(PhaseType.parseRange(triggerPhases));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user