Refactoring

We don't need to override basic methods to just call the basic method again.
This commit is contained in:
vraskulin 2017-01-09 18:13:43 +03:00
parent b626bf6866
commit a9f2c8c407
6 changed files with 4 additions and 25 deletions

View file

@ -66,11 +66,7 @@ public class CastFromGraveyardWatcher extends Watcher {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone().equals(Zone.GRAVEYARD)) {
Spell spell = (Spell) game.getObject(event.getTargetId());
if (spell != null) {
HashSet<Integer> zcc = spellsCastFromGraveyard.get(spell.getSourceId());
if (zcc == null) {
zcc = new HashSet<>();
spellsCastFromGraveyard.put(spell.getSourceId(), zcc);
}
HashSet<Integer> zcc = spellsCastFromGraveyard.computeIfAbsent(spell.getSourceId(), k -> new HashSet<>());
zcc.add(spell.getZoneChangeCounter(game));
}