add redo function on command pattern

This commit is contained in:
jack.zhang
2015-04-15 11:47:25 +08:00
parent 33566805ee
commit 120555f740
6 changed files with 46 additions and 4 deletions

View File

@@ -17,6 +17,13 @@ public class InvisibilitySpell extends Command {
}
}
@Override
public void redo() {
if (target != null) {
target.setVisibility(Visibility.INVISIBLE);
}
}
@Override
public String toString() {
return "Invisibility spell";