mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 00:13:56 +00:00
add redo function on command pattern
This commit is contained in:
1 parent
33566805ee
commit
120555f740
6 files changed
+46
-4
No files matched your search
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user