Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
ravening committed Aug 4, 2020
1 parent b9f1782 commit f234baf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
15 changes: 7 additions & 8 deletions command/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Binary file modified command/etc/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions command/etc/command.urm.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.iluwatar.command {
+ App()
+ main(args : String[]) {static}
}
abstract class Command {
interface Command {
+ Command()
+ execute(Target) {abstract}
+ redo() {abstract}
Expand Down Expand Up @@ -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

0 comments on commit f234baf

Please sign in to comment.