mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
refactor: removed outdated code
This commit is contained in:
parent
fdbc5d6409
commit
52ebba4cd1
31 changed files with 56 additions and 66 deletions
|
|
@ -116,7 +116,7 @@ class CastFromGraveyardOnceWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (GameEvent.EventType.SPELL_CAST.equals(event.getType())
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.CastFromGraveyardOnceWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -511,11 +511,6 @@ public class GameEvent implements Serializable {
|
|||
DAMAGED_BATCH_FOR_ONE_PERMANENT(true),
|
||||
|
||||
DESTROY_PERMANENT,
|
||||
/* DESTROY_PERMANENT_BY_LEGENDARY_RULE
|
||||
targetId id of the permanent to destroy
|
||||
playerId controller of the permanent to detroy
|
||||
*/
|
||||
DESTROY_PERMANENT_BY_LEGENDARY_RULE,
|
||||
/* DESTROYED_PERMANENT
|
||||
targetId id of the destroyed creature
|
||||
sourceId sourceId of the ability with the destroy effect
|
||||
|
|
@ -819,16 +814,12 @@ public class GameEvent implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns possibly approving object that allowed the creation of the event.
|
||||
* Returns possibly approving object that allowed the creation of the event. Used for cast spell and play land events.
|
||||
*/
|
||||
public ApprovingObject getAdditionalReference() {
|
||||
public ApprovingObject getApprovingObject() {
|
||||
return approvingObject;
|
||||
}
|
||||
|
||||
public void setAdditionalReference(ApprovingObject approvingObject) {
|
||||
this.approvingObject = approvingObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* used to store which replacement effects were already applied to an event
|
||||
* or any modified events that may replace it
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class OnceEachTurnCastWatcher extends Watcher {
|
|||
&& event.getPlayerId() != null
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.OnceEachTurnCastWatcher)) {
|
||||
usedFrom.computeIfAbsent(event.getPlayerId(), k -> new HashSet<>())
|
||||
.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue