forked from External/mage
add doc comments for usage of default watchers
This commit is contained in:
parent
a4cc086775
commit
1ac4fe4e4a
11 changed files with 28 additions and 6 deletions
|
|
@ -8,8 +8,6 @@ import mage.game.Game;
|
||||||
import mage.watchers.common.CardsDrawnThisTurnWatcher;
|
import mage.watchers.common.CardsDrawnThisTurnWatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't forget to add CardsDrawnThisTurnWatcher in card's definition
|
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
|
public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
|
||||||
|
|
@ -45,4 +43,3 @@ public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1340,10 +1340,10 @@ public abstract class GameImpl implements Game {
|
||||||
newWatchers.add(new CastSpellLastTurnWatcher());
|
newWatchers.add(new CastSpellLastTurnWatcher());
|
||||||
newWatchers.add(new PlayerLostLifeWatcher());
|
newWatchers.add(new PlayerLostLifeWatcher());
|
||||||
newWatchers.add(new BlockedAttackerWatcher());
|
newWatchers.add(new BlockedAttackerWatcher());
|
||||||
newWatchers.add(new DamageDoneWatcher());
|
newWatchers.add(new DamageDoneWatcher()); // TODO: no need to be default watcher
|
||||||
newWatchers.add(new PlanarRollWatcher());
|
newWatchers.add(new PlanarRollWatcher()); // TODO: no need to be default watcher
|
||||||
newWatchers.add(new AttackedThisTurnWatcher());
|
newWatchers.add(new AttackedThisTurnWatcher());
|
||||||
newWatchers.add(new PlayersAttackedThisTurnWatcher());
|
newWatchers.add(new PlayersAttackedThisTurnWatcher()); // TODO: no need to be default watcher
|
||||||
newWatchers.add(new CardsDrawnThisTurnWatcher());
|
newWatchers.add(new CardsDrawnThisTurnWatcher());
|
||||||
newWatchers.add(new ManaSpentToCastWatcher());
|
newWatchers.add(new ManaSpentToCastWatcher());
|
||||||
newWatchers.add(new ManaPaidSourceWatcher());
|
newWatchers.add(new ManaPaidSourceWatcher());
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ public class AttackedThisTurnWatcher extends Watcher {
|
||||||
// issue with Robber of the Rich. it needs to check the subtype of the LKI of the permanent on the battlefield and this fails with MageObjectReference
|
// issue with Robber of the Rich. it needs to check the subtype of the LKI of the permanent on the battlefield and this fails with MageObjectReference
|
||||||
private final Set<Permanent> attackedThisTurnCreaturesPermanentLKI = new HashSet<>();
|
private final Set<Permanent> attackedThisTurnCreaturesPermanentLKI = new HashSet<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public AttackedThisTurnWatcher() {
|
public AttackedThisTurnWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ public class BlockingOrBlockedWatcher extends Watcher {
|
||||||
|
|
||||||
private final Map<MageObjectReference, Set<MageObjectReference>> blockerMap = new HashMap<>();
|
private final Map<MageObjectReference, Set<MageObjectReference>> blockerMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public BlockingOrBlockedWatcher() {
|
public BlockingOrBlockedWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ public class CommanderPlaysCountWatcher extends Watcher {
|
||||||
private final Map<UUID, Integer> playsCount = new HashMap<>();
|
private final Map<UUID, Integer> playsCount = new HashMap<>();
|
||||||
private final Map<UUID, Integer> playerCount = new HashMap<>();
|
private final Map<UUID, Integer> playerCount = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public CommanderPlaysCountWatcher() {
|
public CommanderPlaysCountWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ public class EndStepCountWatcher extends Watcher {
|
||||||
|
|
||||||
private final Map<UUID, Integer> playerMap = new HashMap<>();
|
private final Map<UUID, Integer> playerMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public EndStepCountWatcher() {
|
public EndStepCountWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,9 @@ public class ManaPaidSourceWatcher extends Watcher {
|
||||||
private static final ManaPaidTracker emptyTracker = new ManaPaidTracker();
|
private static final ManaPaidTracker emptyTracker = new ManaPaidTracker();
|
||||||
private final Map<UUID, ManaPaidTracker> manaMap = new HashMap<>();
|
private final Map<UUID, ManaPaidTracker> manaMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public ManaPaidSourceWatcher() {
|
public ManaPaidSourceWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ public class ManaSpentToCastWatcher extends Watcher {
|
||||||
|
|
||||||
private final Map<MageObjectReference, Mana> manaMap = new HashMap<>();
|
private final Map<MageObjectReference, Mana> manaMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public ManaSpentToCastWatcher() {
|
public ManaSpentToCastWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ public class MorbidWatcher extends Watcher {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game default watcher
|
* Game default watcher
|
||||||
|
* TODO: Merge with CreaturesDiedWatcher
|
||||||
*/
|
*/
|
||||||
public MorbidWatcher() {
|
public MorbidWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ public class SpellsCastWatcher extends Watcher {
|
||||||
private final Map<UUID, List<Spell>> spellsCastFromGraveyard = new HashMap<>();
|
private final Map<UUID, List<Spell>> spellsCastFromGraveyard = new HashMap<>();
|
||||||
private int nonCreatureSpells;
|
private int nonCreatureSpells;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public SpellsCastWatcher() {
|
public SpellsCastWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ public class TemptedByTheRingWatcher extends Watcher {
|
||||||
|
|
||||||
private final Map<UUID, Integer> map = new HashMap<>();
|
private final Map<UUID, Integer> map = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Game default watcher
|
||||||
|
*/
|
||||||
public TemptedByTheRingWatcher() {
|
public TemptedByTheRingWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue