Cleanup code

This commit is contained in:
Rakesh Venkatesh 2020-08-04 16:34:41 +02:00
parent b9f17824fa
commit f234baf258
3 changed files with 12 additions and 13 deletions

View File

@ -75,19 +75,18 @@ public class Wizard {
Next we present the spell hierarchy.
```java
public abstract class Command {
public interface Command {
public abstract void execute(Target target);
void execute(Target target);
public abstract void undo();
void undo();
public abstract void redo();
void redo();
@Override
public abstract String toString();
String toString();
}
public class InvisibilitySpell extends Command {
public class InvisibilitySpell implements Command {
private Target target;
@ -117,7 +116,7 @@ public class InvisibilitySpell extends Command {
}
}
public class ShrinkSpell extends Command {
public class ShrinkSpell implements Command {
private Size oldSize;
private Target target;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -4,7 +4,7 @@ package com.iluwatar.command {
+ App()
+ main(args : String[]) {static}
}
abstract class Command {
interface Command {
+ Command()
+ execute(Target) {abstract}
+ redo() {abstract}
@ -77,7 +77,7 @@ ShrinkSpell --> "-oldSize" Size
InvisibilitySpell --> "-target" Target
ShrinkSpell --> "-target" Target
Target --> "-visibility" Visibility
Goblin --|> Target
InvisibilitySpell --|> Command
ShrinkSpell --|> Command
@enduml
Goblin --|> Target
InvisibilitySpell ..|> Command
ShrinkSpell ..|> Command
@enduml