first batch of watcher naming

This commit is contained in:
igoudt 2017-04-29 08:33:10 +02:00
parent 20a881a374
commit efae1251f9
111 changed files with 177 additions and 179 deletions

View file

@ -31,6 +31,7 @@ import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.watchers.Watcher;
import mage.watchers.common.MorbidWatcher;
/**
* @author nantuko
@ -41,7 +42,7 @@ public enum MorbidCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Watcher watcher = game.getState().getWatchers().get("Morbid");
Watcher watcher = game.getState().getWatchers().get(MorbidWatcher.class.getSimpleName());
return watcher.conditionMet();
}

View file

@ -49,7 +49,7 @@ public enum NoSpellsWereCastLastTurnCondition implements Condition {
return false;
}
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getName());
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
// if any player cast spell, return false
for (Integer count : watcher.getAmountOfSpellsCastOnPrevTurn().values()) {
if (count > 0) {

View file

@ -41,7 +41,7 @@ public enum TwoOrMoreSpellsWereCastLastTurnCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getName());
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
// if any player cast more than two spells, return true
for (Integer count : watcher.getAmountOfSpellsCastOnPrevTurn().values()) {
if (count >= 2) {

View file

@ -100,7 +100,7 @@ class StormEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
MageObjectReference spellRef = (MageObjectReference) this.getValue("StormSpellRef");
if (spellRef != null) {
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getName());
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
int stormCount = watcher.getSpellOrder(spellRef, game) - 1;
if (stormCount > 0) {
Spell spell = (Spell) this.getValue("StormSpell");