refactor the copy functionality for no-args watchers

This commit is contained in:
Ingmar Goudt 2019-04-07 20:22:14 +02:00
parent 311532a6e7
commit 6703ba693d
52 changed files with 73 additions and 538 deletions

View file

@ -21,18 +21,6 @@ public class PlayerAttackedStepWatcher extends Watcher {
super(WatcherScope.GAME);
}
public PlayerAttackedStepWatcher(final PlayerAttackedStepWatcher watcher) {
super(watcher);
for (Map.Entry<UUID, Integer> entry : watcher.playerAttacked.entrySet()) {
this.playerAttacked.put(entry.getKey(), entry.getValue());
}
}
@Override
public PlayerAttackedStepWatcher copy() {
return new PlayerAttackedStepWatcher(this);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DECLARE_ATTACKERS_STEP_POST) {