changed the constructor for a Watcher. Before, you had to explictly pass the name of the watcher as an argument. But most of the time this was the name of the class itself. So the watcher now determines internally its name. The method 'getBasicKey' can be overridden. Also updated some encapsulation

This commit is contained in:
Ingmar Goudt 2019-03-16 08:35:26 +01:00
parent 5c1f41f3a7
commit c4eeec1bb2
178 changed files with 313 additions and 296 deletions

View file

@ -15,14 +15,14 @@ import mage.watchers.Watcher;
*/
public class LandfallWatcher extends Watcher {
final Set<UUID> playerPlayedLand = new HashSet<>(); // player that had a land enter the battlefield
final Set<UUID> landEnteredBattlefield = new HashSet<>(); // land played
private final Set<UUID> playerPlayedLand = new HashSet<>(); // player that had a land enter the battlefield
private final Set<UUID> landEnteredBattlefield = new HashSet<>(); // land played
public LandfallWatcher() {
super(LandfallWatcher.class.getSimpleName(), WatcherScope.GAME);
super(WatcherScope.GAME);
}
public LandfallWatcher(final LandfallWatcher watcher) {
private LandfallWatcher(final LandfallWatcher watcher) {
super(watcher);
playerPlayedLand.addAll(watcher.playerPlayedLand);
landEnteredBattlefield.addAll(watcher.landEnteredBattlefield);